mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
161bdd9359
commit
bb56554a62
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue