FLTK logo

STR #723

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 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #723

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:WIN32
Summary:GDI leak in Win32 -- suggested fix
Version:1.1.6
Created By:greg.ercolano
Assigned To:mike
Fix Version:1.1.7 (SVN: v4041)
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 greg.ercolano
10:45 Feb 13, 2005
WRT the thread on fltk.bugs "fltk-1.1.6 continuous GDI memory leak"

In his case he noticed the 'ask.exe' demo leaking a GDI
each time a window is created and destroyed.

It would appear that i->region created in Fl_Widget::damage()
is indeed not getting destroyed when Fl_Window destructs via Fl_Window::hide().

The problem /appears/ to be here in Fl.cxx..
When I add the noted line and rebuild, ask.exe no longer leaks a GDI.

In 1.1.6 Fl.cxx, the code for Fl_Window::hide(),
in the first "#ifdef WIN32", the section reads:

----
#ifdef WIN32
  if (ip->private_dc) ReleaseDC(ip->xid,ip->private_dc);
  if (ip->xid == fl_window && fl_gc) {
    ReleaseDC(fl_window, fl_gc);
    fl_window = (HWND)-1;
    fl_gc = 0;
  }
  if ( ip->region ) XDestroyRegion(ip->region); <-- ADD THIS TO FIX
#elif defined(__APPLE_QD__)
  if ( ip->xid == fl_window )
    fl_window = 0;
#elif defined(__APPLE_QUARTZ__)
  Fl_X::q_release_context(ip);
  if ( ip->xid == fl_window )
    fl_window = 0;
#else
  if (ip->region) XDestroyRegion(ip->region);
#endif
----
 
 
#2 mike
03:12 Feb 14, 2005
Fixed in Subversion repository.  
     

Return to Bugs & Features ]

 
 

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'.