diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-25 16:53:47 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-25 16:53:47 -0400 |
| commit | e25831c609ed882741dd01f3973be283e1a5bd47 (patch) | |
| tree | a0bad3126a449de257b22c7f2930b95d7fed3dc4 /redo/imagelist_windows.c | |
| parent | 107e66715b1f3b69d3d3df6062d257b746edd6eb (diff) | |
Added cleanup of Windows image lists.
Diffstat (limited to 'redo/imagelist_windows.c')
| -rw-r--r-- | redo/imagelist_windows.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/redo/imagelist_windows.c b/redo/imagelist_windows.c index fab4425..08046e7 100644 --- a/redo/imagelist_windows.c +++ b/redo/imagelist_windows.c @@ -94,11 +94,13 @@ noscale: xpanic("error deleting scaled bitmap", GetLastError()); } -void applyImageList(HWND hwnd, UINT uMsg, WPARAM wParam, HIMAGELIST il) +void applyImageList(HWND hwnd, UINT uMsg, WPARAM wParam, HIMAGELIST il, HIMAGELIST old) { - if (SendMessageW(hwnd, uMsg, wParam, (LPARAM) il) == (LRESULT) NULL) -;//TODO xpanic("error setting image list", GetLastError()); - // TODO free old one here if any + if (SendMessageW(hwnd, uMsg, wParam, (LPARAM) il) != (LRESULT) old) + xpanic("error setting image list", GetLastError()); + if (old != NULL && (*fv_ImageList_Destroy)(old) == 0) + xpanic("error freeing old checkbox image list", GetLastError()); + } static UINT dfcState(int cbstate) |
