[Mono-bugs] [Bug 672879] ReleaseInterfaces is called by GC thread.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 2 14:21:27 EDT 2011



--- Comment #7 from Robert Jordan <robertj at gmx.net> 2011-09-02 18:21:26 UTC ---
No, the finalizer could be implemented like this:

~__ComObject ()
    var ctx = SynchronizationContext.Current;
    if (ctx != null)
        SynchronizationContext.Current.Post(delegate {
             ReleaseInterfaces ();
        ReleaseInterfaces ();

If you app is based on WindowsForms, you don't have to do anything, because
there is an SynContext already set. Otherwise you'd have to inherit from
SynchronizationContext, implement Post and install it with

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list