fix a few resource leaks

svn path=/trunk/; revision=23556
This commit is contained in:
Ged Murphy 2006-08-12 15:17:29 +00:00
parent 7c636c8e1f
commit 635b9fb393

View file

@ -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;
}