mirror of
https://github.com/reactos/reactos.git
synced 2025-07-02 22:21:22 +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) ||
|
if (!AllocAndLoadString(&lpAppName, hInstance, IDS_APPNAME) ||
|
||||||
!AllocAndLoadString(&lpVersion, hInstance, IDS_VERSION) )
|
!AllocAndLoadString(&lpVersion, hInstance, IDS_VERSION) )
|
||||||
{
|
{
|
||||||
return 1;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = (int)_tcslen(lpAppName) + (int)_tcslen(lpVersion);
|
len = (int)_tcslen(lpAppName) + (int)_tcslen(lpVersion);
|
||||||
lpTitle = HeapAlloc(ProcessHeap,
|
lpTitle = HeapAlloc(ProcessHeap,
|
||||||
0,
|
0,
|
||||||
(len + 2) * sizeof(TCHAR));
|
(len + 2) * sizeof(TCHAR));
|
||||||
|
if (lpTitle == NULL)
|
||||||
|
{
|
||||||
|
LocalFree((HLOCAL)lpAppName);
|
||||||
|
LocalFree((HLOCAL)lpVersion);
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
wsprintf(lpTitle,
|
wsprintf(lpTitle,
|
||||||
_T("%s %s"),
|
_T("%s %s"),
|
||||||
lpAppName,
|
lpAppName,
|
||||||
lpVersion);
|
lpVersion);
|
||||||
|
|
||||||
|
LocalFree((HLOCAL)lpAppName);
|
||||||
|
LocalFree((HLOCAL)lpVersion);
|
||||||
|
|
||||||
if (TbdInitImpl())
|
if (TbdInitImpl())
|
||||||
{
|
{
|
||||||
if (InitMainWindowImpl())
|
if (InitMainWindowImpl())
|
||||||
|
@ -62,7 +71,6 @@ WinMain(HINSTANCE hThisInstance,
|
||||||
{
|
{
|
||||||
if (bRet != (BOOL)-1)
|
if (bRet != (BOOL)-1)
|
||||||
{
|
{
|
||||||
//if (Msg.message == WM_SIZE) MessageBox(NULL, _T("Got it"), NULL, 0);
|
|
||||||
if (!MainWndTranslateMDISysAccel(hMainWnd,
|
if (!MainWndTranslateMDISysAccel(hMainWnd,
|
||||||
&Msg))
|
&Msg))
|
||||||
{
|
{
|
||||||
|
@ -87,7 +95,9 @@ WinMain(HINSTANCE hThisInstance,
|
||||||
TbdUninitImpl();
|
TbdUninitImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalFree((HLOCAL)lpAppName);
|
HeapFree(GetProcessHeap(),
|
||||||
|
0,
|
||||||
|
lpTitle);
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue