Hi,

The underlying ObjC objects are refcounted, so they're unreffed when the
managed GC kicks in and frees the managed peer.

In particular you can not assume the ObjC object will be freed, it will
only be unreffed/released.

In general you do not have to worry about destructors when writing
bindings, at least not for the generated code. For your own custom code in
the bindings (if you have any) the same rules applies as for everyone else
(disposing objects when done with them is good, etc.)

Rolf

On Wed, May 23, 2012 at 10:00 PM, spcware <[email protected]> wrote:

> I didn't see much of anything about deallocing objective-c objects when
> writing a C# bindings library.  Can I assume that when the C# garbage
> collector frees the C# object, that the underlying objective-c object will
> get dealloc'ed?  And, that it is up to the underlying object-c object to
> dealloc anything else it is responsible for?
>
> In other words, do I have to worry about destructors and stuff when writing
> a C# binding library?
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/btouch-bindings-destructor-question-tp4652051.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to