Reputation: 1915
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
Reputation: 41
Try this:
protected override void OnClosed(EventArgs e)
{
GeckoWebBrowser.Dispose();
Xpcom.Shutdown();
base.OnClosed(e);
}
Upvotes: 4