mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:06:17 +00:00
fix a few resource leaks
svn path=/trunk/; revision=23556
This commit is contained in:
parent
7c636c8e1f
commit
635b9fb393
1 changed files with 13 additions and 3 deletions
|
@ -29,19 +29,28 @@ WinMain(HINSTANCE hThisInstance,
|
|||
if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME) ||
|
||||
!AllocAndLoadString(&lpVersion, hInstance, IDS_VERSION) )
|
||||
{
|
||||
return 1;
|
||||
return Ret;
|
||||
}
|
||||
|
||||
len = (int)_tcslen(lpAppName) + (int)_tcslen(lpVersion);
|
||||
lpTitle = HeapAlloc(ProcessHeap,
|
||||
0,
|
||||
(len + 2) * sizeof(TCHAR));
|
||||
if (lpTitle == NULL)
|
||||
{
|
||||
LocalFree((HLOCAL)lpAppName);
|
||||
LocalFree((HLOCAL)lpVersion);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
wsprintf(lpTitle,
|
||||
_T("%s %s"),
|
||||
lpAppName,
|
||||
lpVersion);
|
||||
|
||||
LocalFree((HLOCAL)lpAppName);
|
||||
LocalFree((HLOCAL)lpVersion);
|
||||
|
||||
if (TbdInitImpl())
|
||||
{
|
||||
if (InitMainWindowImpl())
|
||||
|
@ -62,7 +71,6 @@ WinMain(HINSTANCE hThisInstance,
|
|||
{
|
||||
if (bRet != (BOOL)-1)
|
||||
{
|
||||
//if (Msg.message == WM_SIZE) MessageBox(NULL, _T("Got it"), NULL, 0);
|
||||
if (!MainWndTranslateMDISysAccel(hMainWnd,
|
||||
&Msg))
|
||||
{
|
||||
|
@ -87,7 +95,9 @@ WinMain(HINSTANCE hThisInstance,
|
|||
TbdUninitImpl();
|
||||
}
|
||||
|
||||
LocalFree((HLOCAL)lpAppName);
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
lpTitle);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue