summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/CMakeSetupDialog.cpp
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-06-04 14:18:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-06-04 14:18:03 (GMT)
commita3cfcd9894a5d626b8beba80fc8b5934ea3f46cf (patch)
tree73155ed903d3138946d64f4da4631954c8601b4e /Source/MFCDialog/CMakeSetupDialog.cpp
parentabab6bc00069df6ff1988abced39b98ea199febc (diff)
downloadCMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.zip
CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.gz
CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.bz2
BUG: clean up memory leaks.
Diffstat (limited to 'Source/MFCDialog/CMakeSetupDialog.cpp')
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
index 0505e50..d6819eb 100644
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -219,6 +219,17 @@ int CALLBACK CMakeSetupDialog_SetSelProc( HWND hWnd, UINT uMsg,
return 0;
}
+inline void ILFree(LPITEMIDLIST pidl)
+{
+ LPMALLOC pMalloc;
+ if (pidl)
+ {
+ SHGetMalloc(&pMalloc);
+ pMalloc->Free( pidl);
+ pMalloc->Release();
+ }
+}
+
// Browse button
bool CMakeSetupDialog::Browse(CString &result, const char *title)
@@ -243,6 +254,7 @@ bool CMakeSetupDialog::Browse(CString &result, const char *title)
{
result = szPathName;
}
+ ILFree(pidl);
return bSuccess;
}