diff options
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) |
