Commit 2e18eec6 authored by Michel Dänzer's avatar Michel Dänzer Committed by Michel Dänzer

xwayland/present: Destroy sync_callback in xwl_present_cleanup

xwl_present_cleanup frees the struct xwl_present_window memory,
so if there's a pending callback, we have to destroy it to prevent
use-after-free in xwl_present_sync_callback.

Should fix issue #645.
Reviewed-by: 's avatarOlivier Fourdan <ofourdan@redhat.com>
parent f665a9c9
Pipeline #23767 passed with stages
in 9 minutes and 52 seconds
...@@ -123,6 +123,11 @@ xwl_present_cleanup(WindowPtr window) ...@@ -123,6 +123,11 @@ xwl_present_cleanup(WindowPtr window)
xwl_present_window->frame_callback = NULL; xwl_present_window->frame_callback = NULL;
} }
if (xwl_present_window->sync_callback) {
wl_callback_destroy(xwl_present_window->sync_callback);
xwl_present_window->sync_callback = NULL;
}
/* Clear remaining events */ /* Clear remaining events */
xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) { xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->event_list, list) {
xorg_list_del(&event->list); xorg_list_del(&event->list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment