On May 6, 3:23 pm, qnxlvr <[EMAIL PROTECTED]> wrote:
> Hello!
>
> We have a problem here with the integration of the Gecko rendering
> engine in one of our dialogs. The Gecko control itself is embedded in
> another control, which provides some high-level functions to our
> developers, and a better abstraction between Gecko, IE, and other
> future rendering engines. This control (LxFireFoxCtl), is then placed
> on a MFC dialog.
>
> When doing a sandbox test on the Gecko control itself (without the
> wrapping LxFireFoxCtl), the control works as expected.
>
> When embedded in a real-world app, and with the LxFireFoxCtl, the
> control, and application, crashes upon exit. This may happen at the
> first time, but usually is encountered after the second or third time
> the dialog closes - seems to be a timing problem or a race condition.
>
> We've done some research, but did not come to a conclusion why or
> where this crash takes place. All we know is that the hidden Gecko
> communication window (the hidden one which receives the Win32
> messages) receives a WM_TIMER message, followed by a broken 0xFFFFFFFF
> message, and afterwards crashes. When embedding the IE engine, this
> does not happen.
>
> We are quite unsure what the fault is, maybe this is a known problem
> and someone can help us.
>
> We *really* want to get rid of the IE control, and replace it by
> Gecko. Help from the Mozilla community would be really appreciated.
>
> Thanks in advance,
> Stefan Szomraky.

Got it! It was the Garbage Collector, which ran approx 3 seconds after
I closed the window the firefox control was in.
The problem was that the MFC dialog the control is embedded in is
itself a COM IDispatch, and is registered as JS object - a bad idea
but neccessary. The dialog dies before the GC runs, ignoring any COM
references held.

The solution was to forcely unlink all JS objects and run the GC via
JS_SetGlobalObject( m_JSContext, NULL);
JS_GC( m_JSContext);
in the OnDestroy method of the ActiveX control embedding FireFox.

The solution works nicely,

Greets,
Stefan Szomraky


PS: Never try to do a JS_DestroyContext(...) as it will interfere with
the other XPCOM components and wrappers!
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to