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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top