From c21732705cf6fe4e456a377374f4b7d472231638 Mon Sep 17 00:00:00 2001 From: fire-eggs Date: Wed, 23 Jun 2021 11:04:03 -0400 Subject: Fix potential memory leak (#241) Signed-off-by: Albrecht Schlosser --- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx') 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 -- cgit v1.2.3