realbasic-plugins
[Top] [All Lists]

Event defines a Byref argument of type Variant

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Event defines a Byref argument of type Variant
From: Alfred Van Hoek <vanhoek at mac dot com>
Date: Sun, 29 Jan 2006 11:04:41 -0500
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
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?

(We don't lock it)

Or is this a special case?

Alfred

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