C
cppdev
Hello,
After reading a few articles,
http://blogs.gotdotnet.com/cbrumme/PermaLink.aspx/e55664b4-6471-48b9-b360-f0fa27ab6cc0
http://blogs.gotdotnet.com/anathan/commentview.aspx/8ec0b7b2-6290-4500-a8c7-1b6c677214cb
i have the following question:
__gc class C
{
C(){ ptr = new Unmanaged(); }
~C(){ delete ptr; ptr = 0; }
void DoWork()
{
//Do we have to HandleRef ref(this, IntPtr(ptr));
ptr->UnmnagedCall();
//or call GC::KeepAlive(this)
}
Unmanaged __nogc* ptr;
};
Do we have to do
HandleRef ref(this, IntPtr(ptr)) or GC::KeepAlive?
No one seems to talk about this. Does MC++ take care of
this problem?
Thanx for any input
After reading a few articles,
http://blogs.gotdotnet.com/cbrumme/PermaLink.aspx/e55664b4-6471-48b9-b360-f0fa27ab6cc0
http://blogs.gotdotnet.com/anathan/commentview.aspx/8ec0b7b2-6290-4500-a8c7-1b6c677214cb
i have the following question:
__gc class C
{
C(){ ptr = new Unmanaged(); }
~C(){ delete ptr; ptr = 0; }
void DoWork()
{
//Do we have to HandleRef ref(this, IntPtr(ptr));
ptr->UnmnagedCall();
//or call GC::KeepAlive(this)
}
Unmanaged __nogc* ptr;
};
Do we have to do
HandleRef ref(this, IntPtr(ptr)) or GC::KeepAlive?
No one seems to talk about this. Does MC++ take care of
this problem?
Thanx for any input