From 2ad243d43db6e72ed64e24af8d350c00ea630a51 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Fri, 13 Nov 2015 12:54:54 +0100 Subject: [PATCH] win32: do not use g_clear_pointer to destroy the window DestroyWindow expects a different calling convenction so we endup getting an error at runtime --- gdk/win32/gdkdisplay-win32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 7b1fbd8738..620dfe7747 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -714,7 +714,12 @@ gdk_win32_display_dispose (GObject *object) { GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (object); - g_clear_pointer (&display_win32->hwnd, (GDestroyNotify)DestroyWindow); + if (display_win32->hwnd != NULL) + { + DestroyWindow (display_win32->hwnd); + display_win32->hwnd = NULL; + } + g_clear_pointer (&display_win32->clipboard_hwnd, (GDestroyNotify)DestroyWindow); _hwnd_next_viewer = NULL;