gdkdisplay-win32.c: Don't call ReleaseDC() unnecessarily
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 19 Jul 2021 09:13:53 +0000 (17:13 +0800)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Jul 2021 14:28:16 +0000 (16:28 +0200)
The dummy Win32 window that we use to capture display change events and
to create dummy WGL contexts was created with CS_OWNDC, so we really do
not need to (and should not) call ReleaseDC() on the HDC that we
obtained from it, so drop these calls.

gdk/win32/gdkdisplay-win32.c

index ab6544a79bdbc5a6c2a10b9353ec8d882f0ef71c..24f60ba3e47a27fb65ae9f68aecd8549c8fe27a1 100644 (file)
@@ -664,12 +664,6 @@ gdk_win32_display_dispose (GObject *object)
           display_win32->dummy_context_wgl.hglrc = NULL;
         }
 
-      if (display_win32->dummy_context_wgl.hdc != NULL)
-        {
-          ReleaseDC (display_win32->hwnd, display_win32->dummy_context_wgl.hdc);
-          display_win32->dummy_context_wgl.hdc = NULL;
-        }
-
       DestroyWindow (display_win32->hwnd);
       display_win32->hwnd = NULL;
     }