Welcome Guest Search | Active Topics | Sign In | Register

Detach must be called in the same thread as Attach Options
Stefan Koell
Posted: Monday, February 27, 2023 2:26:41 AM
Rank: Advanced Member
Groups: Member

Joined: 12/23/2013
Posts: 114
Hi,

I sometimes get crash reports from my users with the following exception/stack trace:

Detach must be called in the same thread as Attach
Code: C#
at EO.Internal.rivx.amyk()
at EO.WebBrowser.WebView.sbgk(Boolean fo)
at EO.WebBrowser.WebView.Destroy()
at EO.WebBrowser.WebView.sbkn(epgu lk, jfom ll)
at EO.Internal.epgu.hhig(rjav e, IntPtr f, Int32 g, IntPtr h, IntPtr i, Boolean& j)
at EO.Internal.rjav.amyq(IntPtr rrv, Int32 rrw, IntPtr rrx, IntPtr rry, Boolean& rrz)
at EO.Internal.rjav.oflb(IntPtr odp, Int32 odq, IntPtr odr, IntPtr ods, Boolean& odt)
at EO.Internal.rjav.ofla(IntPtr odl, Int32 odm, IntPtr odn, IntPtr odo)
at Interop.User32.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.Interop.Mso.IMsoComponentManager.FPushMessageLoop(UIntPtr dwComponentID, msoloop uReason, Void* pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(msoloop reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(msoloop reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)


I triple checked my code and can't really find any interaction with the WebView which is not happening from the UI thread. From what I can see, this mostly happens when my application is closed and when I close/destroy multiple web views.

Any idea how to find out what's going on?

Regards,
Stefan
eo_support
Posted: Monday, February 27, 2023 11:12:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

This might be a bug that we have just fixed. Please download build 23.1.25 from our download page and see if it resolves the issue for you.

Thanks!
Stefan Koell
Posted: Tuesday, February 28, 2023 1:36:13 AM
Rank: Advanced Member
Groups: Member

Joined: 12/23/2013
Posts: 114
Will do, thank you!
sebaot
Posted: Friday, March 3, 2023 6:25:15 AM
Rank: Newbie
Groups: Member

Joined: 9/16/2015
Posts: 6
I updated to 23.1.25 on my WinForms app to try resolve this, but everytime I close the MDI parent with a web control visible in an open MDI child, I'm seeing:

System.InvalidOperationException
HResult=0x80131509
Message=Detach must be called in the same thread as Attach.
Source=EO.Base
StackTrace:
at EO.Internal.pxpk.uqcf()

It does not happen if I close an MDI child and keep the MDI parent open. Anyway, I found this stops the issue from happening for me:

private void MdiParent_FormClosing(object sender, FormClosingEventArgs e)
{
Application.DoEvents();
...
}
eo_support
Posted: Friday, March 3, 2023 10:32:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Can you try to isolate the problem into a small test project and send the test project to us? See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have the test project we will look into it immediately.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.