summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-10-08 23:42:00 -0500
committerDudemanguy <random342@airmail.cc>2022-10-08 23:50:55 -0500
commitbb56554a623a661d020887ba788cac945e93c78a (patch)
tree0eb209aff0310728f3c3a7910f2038b09d745caf
parent161bdd9359cfb1131d36cc1596a2a0ad7e481b18 (diff)
downloadmpv-bb56554a623a661d020887ba788cac945e93c78a.tar.bz2
mpv-bb56554a623a661d020887ba788cac945e93c78a.tar.xz
x11: fix a couple of memory leaks
Managed to go completely unnoticed for months (who was the bad person that introduced these*). Fairly self-explanatory. After getting ProviderInfo from randr, we need to free it. The other one is pretty bad because it leaked every frame (ouch). It turns out that you're supposed to free any event data after you cast a generic event to an XGenericEventCookie. Free that as well. *: It was me.
-rw-r--r--video/out/x11_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 0b711d49ed..7ae27eb009 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -439,6 +439,7 @@ static void xrandr_read(struct vo_x11_state *x11)
x11->has_mesa = x11->has_mesa || amd >= 0 || intel >= 0 ||
nouveau >= 0 || radeon >= 0;
x11->has_nvidia = x11->has_nvidia || nvidia >= 0;
+ XRRFreeProviderInfo(info);
}
if (x11->present_code)
xpresent_set(x11);
@@ -1315,6 +1316,7 @@ void vo_x11_check_events(struct vo *vo)
present_event->msc);
}
}
+ XFreeEventData(x11->display, cookie);
break;
}
default: