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

new topic     » topic index » view message » categorize

2. Re: Win32Lib resource leak FIX

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu