Remove a possibility for lua to cause X11 errors
The lua code could keep a reference to out cairo surface for a drawin after it was destroyed. So make sure the surface is finished before the associated drawable is destroyed. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
da78a89dcd
commit
f57dbb6a78
|
@ -61,6 +61,14 @@ drawin_systray_kickout(drawin_t *w)
|
|||
static void
|
||||
drawin_wipe_resources(drawin_t *w)
|
||||
{
|
||||
if(w->surface)
|
||||
{
|
||||
/* Make sure that cairo knows that this surface can't be unused anymore.
|
||||
* This is needed since lua could still have a reference to it. */
|
||||
cairo_surface_finish(w->surface);
|
||||
cairo_surface_destroy(w->surface);
|
||||
w->surface = NULL;
|
||||
}
|
||||
if(w->window)
|
||||
{
|
||||
/* Activate BMA */
|
||||
|
@ -77,11 +85,6 @@ drawin_wipe_resources(drawin_t *w)
|
|||
xcb_free_pixmap(globalconf.connection, w->pixmap);
|
||||
w->pixmap = XCB_NONE;
|
||||
}
|
||||
if(w->surface)
|
||||
{
|
||||
cairo_surface_destroy(w->surface);
|
||||
w->surface = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue