fixed resource leak (DestroyMenu before destroying main window)
fixed pointer cast warning -> UlongtoPtr (thx to Alex)
Modified: trunk/rosapps/devutils/zoomin/framewnd.c
Modified: trunk/rosapps/devutils/zoomin/main.c
_____
Modified: trunk/rosapps/devutils/zoomin/framewnd.c
--- trunk/rosapps/devutils/zoomin/framewnd.c 2005-11-15 00:33:28 UTC
(rev 19237)
+++ trunk/rosapps/devutils/zoomin/framewnd.c 2005-11-15 01:25:56 UTC
(rev 19238)
@@ -29,6 +29,7 @@
#include "main.h"
#include "framewnd.h"
+extern void ExitInstance();
////////////////////////////////////////////////////////////////////////
////////
// Global Variables:
@@ -228,6 +229,7 @@
case WM_DESTROY:
KillTimer(hWnd, 0);
PostQuitMessage(0);
+ ExitInstance();
break;
default:
_____
Modified: trunk/rosapps/devutils/zoomin/main.c
--- trunk/rosapps/devutils/zoomin/main.c 2005-11-15 00:33:28 UTC
(rev 19237)
+++ trunk/rosapps/devutils/zoomin/main.c 2005-11-15 01:25:56 UTC
(rev 19238)
@@ -68,7 +68,7 @@
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 @@
DestroyMenu(hMenuFrame);
}
-
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
@@ -116,6 +115,5 @@
DispatchMessage(&msg);
}
}
- ExitInstance();
return msg.wParam;
}
Show replies by date