From 6ea14b45da989b5f84c5838dda555d25d3598c77 Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 6 Mar 2007 20:35:53 +0000 Subject: [PATCH] size optimization it's official. even msdn now says SHGetMalloc returns the same allocator CoTaskMemFree uses and a little debugging backs this even on Windows 95 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4978 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 2 +- Source/exehead/util.c | 13 +------------ Source/exehead/util.h | 1 - 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index cab79bbd..60fcbf27 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -951,7 +951,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (idlist) { // free idlist - FreePIDL(idlist); + CoTaskMemFree(idlist); addtrailingslash(dir); diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 9da46b97..edb95d8f 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -49,17 +49,6 @@ NSIS_STRING g_usrvars[1] __attribute__((section (NSIS_VARS_SECTION))); # endif #endif -void NSISCALL FreePIDL(LPITEMIDLIST idl) -{ - IMalloc *m; - SHGetMalloc(&m); - if (m) - { - m->lpVtbl->Free(m, idl); - m->lpVtbl->Release(m); - } -} - HANDLE NSISCALL myCreateProcess(char *cmd, char *dir) { DWORD d; @@ -627,7 +616,7 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab) if (!SHGetSpecialFolderLocation(g_hwnd, fldrs[x], &idl)) { BOOL res = SHGetPathFromIDList(idl, out); - FreePIDL(idl); + CoTaskMemFree(idl); if (res) { break; diff --git a/Source/exehead/util.h b/Source/exehead/util.h index 27e6beec..19257f6b 100644 --- a/Source/exehead/util.h +++ b/Source/exehead/util.h @@ -32,7 +32,6 @@ char * NSISCALL mystrcat(char *out, const char *concat); char * NSISCALL mystrstr(char *a, char *b); WIN32_FIND_DATA * NSISCALL file_exists(char *buf); char * NSISCALL my_GetTempFileName(char *buf, const char *dir); -void NSISCALL FreePIDL(LPITEMIDLIST idl); //BOOL NSISCALL my_SetWindowText(HWND hWnd, const char *val); #define my_SetWindowText SetWindowText