FLTK logo

[master] c217327 - Fix potential memory leak (#241)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] c217327 - Fix potential memory leak (#241) "fire-eggs" Jun 26, 2021  
 
commit c21732705cf6fe4e456a377374f4b7d472231638
Author:     fire-eggs <kbroutley@gmail.com>
AuthorDate: Wed Jun 23 11:04:03 2021 -0400
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Sat Jun 26 15:46:56 2021 +0200

    Fix potential memory leak (#241)
    
    Signed-off-by: Albrecht Schlosser <albrechts.fltk@online.de>

 src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 6e5d693..e47a901 100644
--- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ 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
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.