diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-25 21:45:01 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-25 21:45:01 +0100 |
| commit | 55211af76164fe6c39249c14be47363d35a4db0f (patch) | |
| tree | 417d9e8805c52d6421798331bea59993e7f1fa1a /alf/alfcombobox.cpp | |
| parent | 02d94ecd62e11e28ba87451c392cc6b633bb5c56 (diff) | |
add memory allocation functions
Diffstat (limited to 'alf/alfcombobox.cpp')
| -rw-r--r-- | alf/alfcombobox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alf/alfcombobox.cpp b/alf/alfcombobox.cpp index 409d64f..df88730 100644 --- a/alf/alfcombobox.cpp +++ b/alf/alfcombobox.cpp @@ -370,16 +370,16 @@ ALF_ComboBoxSetCurrentIndex(HWND combo, int index) SendMessage(combo, CB_SETCURSEL, (WPARAM)index, 0); } -TCHAR * // free with HeapFree +TCHAR * // free with ALF_Free ALF_ComboBoxStringForIndex(HWND combo, int index) { int len = (int)SendMessage(combo, CB_GETLBTEXTLEN, (WPARAM)index, 0); if (len > 0) { - TCHAR* buf = (TCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY|HEAP_GENERATE_EXCEPTIONS, (len + 1)*sizeof(WCHAR)); + TCHAR* buf = ALF_New(TCHAR, len + 1); if (SendMessage(combo, CB_GETLBTEXT, (WPARAM)index, (LPARAM)buf)) { return buf; } else { - HeapFree(GetProcessHeap(), 0, buf); + ALF_Free(buf); } } |
