[fpc-pascal] Layout of class method

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Mar 12 22:45:59 CET 2008


On Wed, Mar 12, 2008 at 3:56 PM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>  Aren't you going to have problems with memory leaks with these wrapper
>  instances? Suppose you create an instance in Pascal code, then pass
>  the (wrapped) Objective-C class instance to an Objective-C method
>  which releases it -> how will the Pascal wrapper instance ever be
>  released?

I don't know any example of a method in Cocoa which may or not release
the class depending on something. If it surely frees the class, then
you can set MyObject.Handle to nil before freeing it. Else there
exists no problem.

I'm building a nice way to create Cocoa apps in Pascal, not a generic
object-oriented objective-c bridge.

The main aim is creating a Lazarus-Cocoa widgetset, and maybe adding
some Cocoa to the LCL-Carbon widgetset to get TTrayIcon implemented.

I personally consider my bindings good enougth to be used to create
pure Cocoa applications, but I have no need to develop Cocoa specific
applications.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list