Alexander Smirnov wrote:
> But how GC knows when to free such objects? When it frees such objects?

It frees them, when no other managed reference is pointing
to them.

> Could GC free the object when I still need it? 
> for example
> 
> void func() {
>   MonoString* str=mono_string_new (domain, "some text");
>   /*
>    could GC free str before "using str", if no, why?
>   */
>   // using str
> }


If you want to use "str" after func () in unwound, then
you have to obtain a gchandle for "str". See Mono's
mono_gchandle_* functions.

Robert

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to