astadtla / csexwb2

Automatically exported from code.google.com/p/csexwb2
0 stars 0 forks source link

Application won't quit #85

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, everyone.

I'm having a problem that I'm hoping someone else knows something about, 
after I upgraded to version 2.0.0.2. Unfortunately I can't figure out which 
version I was using... no version string anywhere as far as I can tell. I 
don't even know if it was downloaded as a binary or built from source.

I upgraded to 2.0.0.2 because the older version had a bug in 
LoadHtmlIntoBrowser() making it not display the HTML relative to the given 
URL (meaning that relative paths for CSS and image files would screw up the 
layout from time to time). That has been fixed in 2.0.0.2, but then I'm 
running into this.

Now I have the problem that if I visit a website through Navigate2() or 
Navigate() (which is also used in the application), my application won't 
quit. Seemingly randomly, it will give me this error upon closing the 
application:

----- SNIP -----
Context 0x125248' is disconnected.  Releasing the interfaces from the 
current context (context 0x125020).This may cause corruption or data loss. 
To avoid this problem, please ensure that all contexts/apartments stay 
alive until the applicationis completely done with the 
RuntimeCallableWrappers that represent COM components that liveinside them.
----- SNIP -----

I don't even known what's meant by the concepts of contexts or apartments 
here. There are no such words in my code so I can only presume this is 
something internal to csExWB.

I've tried eperimenting with .Stop(), .Dispose() and all sorts of trickery 
like that, when the main form closes, but to no avail.

When my form quits, I've noticed that the boolean WebbrowserObject.Busy 
flag is true, no matter whether csExWB is doing anything during shutdown or 
not.

Any ideas would be highly appreciated. Thanks in advance.

Original issue reported on code.google.com by helgi.bi...@gmail.com on 18 Dec 2009 at 4:19

GoogleCodeExporter commented 8 years ago
i have the same problem

Original comment by wilw...@gmail.com on 11 Mar 2010 at 11:10

GoogleCodeExporter commented 8 years ago

Sometimes I experience this too!

Original comment by A.Bouchl...@gmail.com on 15 Mar 2010 at 10:29

GoogleCodeExporter commented 8 years ago
I see the "seemingly random" warning only when debugging. It's a Visual Studio 
debug message. Also happens in the Demo application.

Original comment by j.diog...@gmail.com on 13 Nov 2010 at 9:19

GoogleCodeExporter commented 8 years ago
A possible (ugly & dirty) workaround is to call 
System.Diagnostics.Process.GetCurrentProcess().Kill() on exit.

Original comment by j.diog...@gmail.com on 21 Nov 2010 at 5:09

GoogleCodeExporter commented 8 years ago
I found out that it's caused by ComUtilities method 
CProxy_IUtilManEvents::Fire_OnStartManagedAPP(). This method passes object from 
ComUtilities in event arguments. Once this object reaches C# workld in cEXWB 
class, it's really difficult to release it correctly because it's originated in 
different thread. this causes those "Context 0x125248' is disconnected." error 
or even deadlocks in finalizer queue that prevent application from exit.

I removed (commented out) part of CManagedAppBridge::StartInternal() method 
that fires this method because I don't need it for my app. Since then I have no 
error or hang during application exit.

Original comment by xkatu...@gmail.com on 16 Jun 2011 at 11:46