From 4a8265048d080a4ff5e88bf99d157e99ebc7bf30 Mon Sep 17 00:00:00 2001 From: Jack Punter Date: Mon, 6 Jun 2022 15:03:08 +0100 Subject: [PATCH] Fix Handle leak in windows platform Also fix a typo in my previous commit :| --- custom/4coder_lister_base.cpp | 2 +- platform_win32/win32_4ed_functions.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/4coder_lister_base.cpp b/custom/4coder_lister_base.cpp index c67a0361..640fa737 100644 --- a/custom/4coder_lister_base.cpp +++ b/custom/4coder_lister_base.cpp @@ -296,7 +296,7 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){ y_pos += first_index*block_height; i32 max_count = first_index + lister->visible_count + 3; - count = clamp_to(lister->filtered.count, max_count); + count = clamp_top(lister->filtered.count, max_count); for (i32 i = first_index; i < count; i += 1){ Lister_Node *node = lister->filtered.node_ptrs[i]; diff --git a/platform_win32/win32_4ed_functions.cpp b/platform_win32/win32_4ed_functions.cpp index 6e449b1d..79d02b7d 100644 --- a/platform_win32/win32_4ed_functions.cpp +++ b/platform_win32/win32_4ed_functions.cpp @@ -335,6 +335,7 @@ system_get_file_list_sig(){ result.infos[counter] = node; counter += 1; } + FindClose(search); } return(result); @@ -474,7 +475,7 @@ color_picker_hook(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam){ if(GetDlgCtrlID(swatch_window) == 0x2c5) { CHOOSECOLORW *win32_params = - (CHOOSECOLORW *)GetWindowLongPtr(Window, GWLP_USERDATA); + (CHOOSECOLORW *)GetWindowLongPtr(Window, GWLP_USERDATA); if(win32_params) { Color_Picker *picker = (Color_Picker*)win32_params->lCustData;