realbasic-plugins
[Top] [All Lists]

Re: REALpicture and memory management

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: REALpicture and memory management
From: Björn Eiríksson <bjorn at einhugur dot com>
Date: Fri, 21 Jul 2006 09:04:58 +0000
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <0EAE1376-C3A0-4C15-8758-1230D7D24658 at mobleybros dot com>
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)

Björn

Phil M wrote:
I have a function in my plugin which accepts a REALpicture, does something with it and then creates a new REALpicture to return. Function prototype looks like this:

    static REALpicture InvertRGB(REALpicture thePict);

Do I need to free/unlock either the function parameter or the return value? Or is unlocking only required for a matching Lock request?


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



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


<Prev in Thread] Current Thread [Next in Thread>