realbasic-plugins
[Top] [All Lists]

Re: REALLoadObjectMethod leaking memory?

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: REALLoadObjectMethod leaking memory?
From: Jonathan Johnson <jonj at realsoftware dot com>
Date: Sun, 15 Jan 2006 14:30:32 -0600
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ujmdQ2C81maOqUz/deF6GjnMs2wANLbegtdE/7Fasv1vmsLwIVTSON7NjUaR75kf0xrEznVDZtQv84p7YoNqa/IB7MMXHNuM8SO2xqjHt6r6HfxM75ltR/Uhza0MfOpMWu1qvkD+/4nTFnC9d9pTXNkYn9euLV6YX4wBNkBmqbo=
References: <BFF05CE8 dot FED8%alexander dot traud at macnews dot de> <0f9b1bbc5e4e0acfe6b8540d2ddf0123 at mac dot com>
On 1/15/06, Alfred Van Hoek <vanhoek at mac dot com> wrote:
>
> On Jan 15, 2006, at 2:11 PM, Alexander Traud wrote:
>
> >> happy that these function pointers are not destroyed magically.
> >
> > Yes, but several strings on the heap are something else than a function
> > pointer. Yes, a REALbasic function pointer could move but we have
> > concepts
> > like handles or similar for something like that. I see no reason why
> > the
> > *NAME of a parameter* is hold on the heap.
> >
>
> Not that I don't agree with you. Dynamic access evaluates the complete
> signature to allow screening for overloaded methods, which can contain
> optional parameters, contrary to RB's plugin API's. Plugin API's use
> "Direct Access" entry points, which screen for the method name only.
> Plugin API function pointers are persistent following lazily creation.
> In Dynamic Access NAME and DEFAULT value, or OPTIONAL on the heap may
> be essential, but this is based on a gut feeling only.

I think there's a misunderstanding on what REALLoadObjectMethod does.
It simply scans the class of the object passed in for a method
matching the signature. You are responsible for specifying all the
parameters, including optional ones, and you are responsible for
passing all parameters in. The returned result is simply the same
function pointer that REALbasic calls through the vtable. There is no
need to unlock anything.

If there is a leak, that's a bug. Please file a report with an
included example plugin and project.

Thanks,
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>


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