On 21 Jul 2006, at 14:01, Phil M wrote:

On Jul 21, 2006, at 5:04 AM, Björn Eiríksson wrote:

You do not need to unlock thePict parameter unless you locked it for some reason.

The return value may need a lock:
If you created the Picture in the function then the reference count is 1 and no additional lock should be done. If you are returning thePict (image that you did not create your self )then you need to Lock it to increase the reference count)

OK.

It seems I have a memory leak somewhere and I just have to find it. I disabled the picture so my return value is NULL, and the leak continued to occur so it is something with my code.

REALpicture Function() {
        REALpicture bla = REALnewPicture(a,b,c);
        return bla; // this wonn't leak
}

REALpicture Function() {
        REALpicture bla = REALnewPicture(a,b,c);
        return 0; // this WILL leak
} // because we created "bla", but now nothing can unlock it.


Just so you know._______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to