fixed resource leak (DestroyMenu before destroying main window)
authorChristoph von Wittich <christoph_vw@reactos.org>
Tue, 15 Nov 2005 01:25:56 +0000 (01:25 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Tue, 15 Nov 2005 01:25:56 +0000 (01:25 +0000)
fixed pointer cast warning -> UlongtoPtr (thx to Alex)

svn path=/trunk/; revision=19238

rosapps/devutils/zoomin/framewnd.c
rosapps/devutils/zoomin/main.c

index 3cd95e4..2718aa4 100644 (file)
@@ -29,6 +29,7 @@
 #include "main.h"
 #include "framewnd.h"
 
+extern void ExitInstance();
 
 ////////////////////////////////////////////////////////////////////////////////
 // Global Variables:
@@ -228,6 +229,7 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
        case WM_DESTROY:
                KillTimer(hWnd, 0);
                PostQuitMessage(0);
+               ExitInstance();
                break;
 
        default:
index 1a84f26..85b496c 100644 (file)
@@ -68,7 +68,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 
        hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN_MENU));
 
-    hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle,
+    hFrameWnd = CreateWindowEx(0, (LPCTSTR)UlongToPtr(hFrameWndClass), szTitle,
                     WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE | WS_VSCROLL,
                     CW_USEDEFAULT, CW_USEDEFAULT, 250, 250,
                     NULL, hMenuFrame, hInstance, NULL/*lpParam*/);
@@ -90,7 +90,6 @@ void ExitInstance(void)
     DestroyMenu(hMenuFrame);
 }
 
-
 int APIENTRY WinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPSTR     lpCmdLine,
@@ -116,6 +115,5 @@ int APIENTRY WinMain(HINSTANCE hInstance,
             DispatchMessage(&msg);
         }
     }
-    ExitInstance();
     return msg.wParam;
 }