summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
diff options
context:
space:
mode:
authorfire-eggs <kbroutley@gmail.com>2021-06-23 11:04:03 -0400
committerAlbrecht Schlosser <albrechts.fltk@online.de>2021-06-26 15:46:56 +0200
commitc21732705cf6fe4e456a377374f4b7d472231638 (patch)
tree18f9d0ca0ee5bcc264961e2d71aba9b45d1ac220 /src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
parent571ff10553a852a30753031e31c65af7b8ebbb7b (diff)
Fix potential memory leak (#241)
Signed-off-by: Albrecht Schlosser <albrechts.fltk@online.de>
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 6e5d693f4..e47a901be 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -475,7 +475,10 @@ void Fl_WinAPI_Window_Driver::hide() {
}
}
- if (hide_common()) return;
+ if (hide_common()) {
+ delete[] doit; // note: `count` and `doit` may be NULL (see PR #241)
+ return;
+ }
// make sure any custom icons get freed
// icons(NULL, 0); // free_icons() is called by the Fl_Window destructor