[Mono-dev] Embedded API - pinning objects

Olexandr Melnyk omelnyk at gmail.com
Mon Jun 29 16:32:42 EDT 2009


Hello Steve,
call mono_gchandle_new() after creating the object and mono_gchandle_free()
when you don't need it.

On Mon, Jun 29, 2009 at 7:27 PM, Steve Baer <steve at mcneel.com> wrote:

>
> Hi,
> I've just started playing with embedding mono in a C++ app so I'll probably
> have plenty more questions.
>
> I'm a little confused about the "lifetime" of a MonoObject*. Say I create a
> MonoObject with the following code
>
> MonoObject* mobj = mono_object_new(domain, mclass);
> mono_object_init(mobj);
>
> Is mobj "pinned" in memory and if so what can I call to release the object?
> -OR-
> Do I need to immediately call mono_gchandle_new on mobj so the pointer
> stays
> valid while I use it?
>
> Thanks,
> -Steve
> --
> View this message in context:
> http://www.nabble.com/Embedded-API---pinning-objects-tp24257413p24257413.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090629/d59bb532/attachment.html 


More information about the Mono-devel-list mailing list