Fixed cleanup of xfc->drawable.
@@ -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);
}
