]> granicus.if.org Git - nethack/commitdiff
Delete GDI objects when map window is destroyed.
authorBart House <bart@barthouse.com>
Fri, 16 Nov 2018 21:50:12 +0000 (13:50 -0800)
committerBart House <bart@barthouse.com>
Fri, 16 Nov 2018 21:50:12 +0000 (13:50 -0800)
win/win32/mhmap.c

index 4afdf6e3ac51abdc9b37ea4a2471cf010d48cddd..a1690ef8efa67434929e3a9633cb78a6b94567f4 100644 (file)
@@ -566,6 +566,10 @@ MapWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
     case WM_DESTROY:
         if (data->hMapFont)
             DeleteObject(data->hMapFont);
+        if (data->hBackBuffer)
+            DeleteBitmap(data->hBackBuffer);
+        if (data->backBufferDC)
+            DeleteDC(data->backBufferDC);
         free(data);
         SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) 0);
         break;