xfreerdp: fix segfault when closing.

This commit is contained in:
Vic Lee 2011-08-22 17:21:39 +08:00
parent c08fef7d33
commit 0c60fafebd

View File

@ -357,9 +357,14 @@ void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon)
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
{
XFreeGC(xfi->display, window->gc);
XFreePixmap(xfi->display, window->surface);
XUnmapWindow(xfi->display, window->handle);
XDestroyWindow(xfi->display, window->handle);
if (window->gc)
XFreeGC(xfi->display, window->gc);
if (window->surface)
XFreePixmap(xfi->display, window->surface);
if (window->handle)
{
XUnmapWindow(xfi->display, window->handle);
XDestroyWindow(xfi->display, window->handle);
}
xfree(window);
}