OSDN Git Service

Fix a crash during exit observed on Windows Vista
authorJochen Tucht <jtuc@users.sourceforge.net>
Sun, 26 Oct 2008 10:50:15 +0000 (10:50 +0000)
committerJochen Tucht <jtuc@users.sourceforge.net>
Sun, 26 Oct 2008 10:50:15 +0000 (10:50 +0000)
Externals/heksedit/main.cpp

index cca78f7..f3c4d71 100644 (file)
@@ -189,7 +189,7 @@ int WINAPI WinMain(HINSTANCE hIconInstance, HINSTANCE, char *szCmdLine, int)
 \r
        while (GetMessage(&msg, NULL, 0, 0))\r
        {\r
-               if (!pHexWnd->translate_accelerator(&msg))\r
+               if (!pHexWnd || !pHexWnd->translate_accelerator(&msg))\r
                {\r
                        TranslateMessage(&msg);\r
                        DispatchMessage(&msg);\r
@@ -309,6 +309,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
                        pHexWnd->iWindowHeight = wndpl.rcNormalPosition.bottom - pHexWnd->iWindowY;\r
                        pHexWnd->save_ini_data();\r
                        DragAcceptFiles(hwndMain, FALSE);\r
+                       pHexWnd = 0;\r
                        PostQuitMessage(0);\r
                }\r
                break;\r