Fixed cleanup of xfc->drawable.

This commit is contained in:
Armin Novak 2018-02-09 11:42:18 +01:00
parent 50c7777bbb
commit 1b9da01612

View File

@ -645,12 +645,6 @@ BOOL xf_create_window(xfContext* xfc)
static void xf_window_free(xfContext* xfc)
{
if (xfc->gc_mono)
{
XFreeGC(xfc->display, xfc->gc_mono);
xfc->gc_mono = 0;
}
if (xfc->window)
{
xf_DestroyDesktopWindow(xfc, xfc->window);
@ -682,6 +676,12 @@ static void xf_window_free(xfContext* xfc)
xfc->bitmap_mono = 0;
}
if (xfc->gc_mono)
{
XFreeGC(xfc->display, xfc->gc_mono);
xfc->gc_mono = 0;
}
if (xfc->primary)
{
XFreePixmap(xfc->display, xfc->primary);
@ -1312,6 +1312,11 @@ static void xf_post_disconnect(freerdp* instance)
xfc->xfDisp = NULL;
}
if (xfc->drawable == xfc->window->handle)
xfc->drawable = NULL;
else
xf_DestroyDummyWindow(xfc, xfc->drawable);
xf_window_free(xfc);
xf_keyboard_free(xfc);
}