1. Win32Lib resource leak FIX
- Posted by Andy Drummond <kestrelandy at xalt.co.uk> Jun 13, 2002
- 412 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.
2. Re: Win32Lib resource leak FIX
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 16, 2002
- 405 views
Thanks Andy, this is one of the resource leaks! I've amended deleteObject to delete whatever object was passed to it. ----- Original Message ----- From: "Andy Drummond" <kestrelandy at xalt.co.uk> To: "EUforum" <EUforum at topica.com> Subject: Win32Lib resource leak FIX > > 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. > > > >