gcroot and weak references

  • Thread starter Thread starter Steve McLellan
  • Start date Start date
S

Steve McLellan

Hi,

I see that GCHandle can encapsulate a weak reference, but gcroot appears to
only allow 'normal' GCHandles. Is this correct or is there something I've
missed?

Ta,

Steve
 
Steve,
I see that GCHandle can encapsulate a weak reference, but gcroot appears to
only allow 'normal' GCHandles. Is this correct or is there something I've
missed?

It's not surprising, given the main use of gcroot. However, it should be
fairly trivial to write an implementation of it that supports other types of
handles (although, in that case, there are a few overloaded operators I'd
avoid...)
 
Steve,
It's not surprising, given the main use of gcroot. However, it should be
fairly trivial to write an implementation of it that supports other types of
handles (although, in that case, there are a few overloaded operators I'd
avoid...)

OK, cheers, think I've worked around it. You're right - supporting other
types wouldn't be that hard - but I've a great talent for writing
hard-to-find pointer bugs.

Cheers,

Steve
 
Back
Top