Barun
Barun

Reputation: 1915

GeckoFX showing error when disposing

I am using GeckoFX 13 for my desktop application. So I have a main form which is opening another form with GeckoWebBrowser when required. I am using another Gecko browser into my main form also. Everything is working fine except when I am closing the application its showing this error

COM object that has been separated from its underlying RCW cannot be used.

Its a dispose related problem. I know as 2nd form is a different thread thats why showing this error. But I need to know the solution. I did not have this problem with GeckoFX-8. Any solution or suggestions will be highly appreciated.

Thanks

Upvotes: 1

Views: 1489

Answers (1)

Enrique
Enrique

Reputation: 41

Try this:

protected override void OnClosed(EventArgs e)
{
   GeckoWebBrowser.Dispose();
   Xpcom.Shutdown();
   base.OnClosed(e);
}

Upvotes: 4

Related Questions