On 1/29/06, Alfred Van Hoek <vanhoek at mac dot com> wrote:
> Given an event declaration like:
>
> "GetValue(selector as Integer, Byref Value As Variant) As Integer"
>
> The event is very simply implemented:
>
> Value = new Script // note: a plugin class not derived from RBScript
>
> return 0
>
> In plugin code we extract the script instance from the variant, and it
> appears that the refcount to this class remains 1 after returning from
> the event. Don't understand this, shouldn't the instance be unlocked
> automatically by RB once we loose scope, at least when returning to the
> main event loop?
It should only have one reference count. However, I think you'll find
that the value parameter you passed in byref actually contains a
different variant than you originally passed in. If the original
variant only has one reference, then it should be freed.
HTH,
Jon
--
Jonathan Johnson
REAL Software, Inc.
REAL World 2006, The REALbasic User's Conference
<http://www.realsoftware.com/realworld>
_______________________________________________
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>
|