Win32Lib resource leak FIX
- Posted by Andy Drummond <kestrelandy at xalt.co.uk> Jun 13, 2002
- 411 views
I have had huge resource leak problems with two routines specially, setWindowBackColor() and setText(). I have found that though setWindowBackColor calls deleteObject() to delete the previous brush, if you look at deleteObject() documentation it does say the object MUST have been tracked with trackObject(). ... so I added trackObject() to setWindowBackColor() routine after it had gotten a new brush, and hey presto! the resource leak stopped. The brush object was being deleted properly. I notice there are other deleteObject() calls in Win32Lib which do not "seem" to have trackObject() call associated - so maybe this is a/the cause of some resource leak troubles other people have been having. Maybe. Andy Drummond.