cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.87k stars 2.92k forks source link

Wpf lifespan handler crash after opening popup twice #1232

Closed Antonyo closed 9 years ago

Antonyo commented 9 years ago

Version

v43.0.0-pre01 or current delopment code. Only in wpf. Windows 8.1 x86.

Description

If you have a Lifespan Handler registered which returns a CefSharp.Wpf.ChromiumWebBrowser as new browser, the second time a popup is open the vshost process crashes with an untraceable exception.

How to recreate

amaitland commented 9 years ago

Thanks for the detailed bug report :+1:

Looks like the bug is only apparent when providing a new ChromiumWebBrowser to host the popup.

https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf.Example/Handlers/LifespanHandler.cs#L11

amaitland commented 9 years ago

@Antonyo Did you have any luck debugging this one?

Antonyo commented 9 years ago

Sorry not yet @amaitland I will give another look at it this weekend. Keep you updated.

amaitland commented 9 years ago

Keep you updated.

Great, thanks :+1:

amaitland commented 9 years ago

Changing to process-per-tab seems to resolve this bug as I cannot reproduce the error using the cefsharp/43 branch https://github.com/cefsharp/CefSharp/commit/56766723785dc82c6c7b539f90c553e8faf0eb95

So I'm guessing it's something in the render process that is causing the problem.

Antonyo commented 9 years ago

Thanks @amaitland, using process-per-tab did solve the issue. I didn't have much time to debug it, only think I discover is that the browser was destroyed immediately after created but I couldn't trace it. I will try to see if process-per-tab works in our scenario.

amaitland commented 9 years ago

process-per-tab is now the default for both 43 and master (45), so making this as closed.

Reopen if required.