WebBrowserComponent crashing on windows when re-inserting plugin

Hello, I’m having an issue on windows when embedding the web browser component (WebView2) into my plugin. When I remove the last instance of the plugin from my session (Ableton), and then re add a new instance, the plugin and daw crash. I’ve pinpointed the issue to be due to the way the WinRTWrapper singleton is declared here:

The doNotRecreateAfterDeletion parameter is passed in as true which does not allow the web view to be recreated once destroyed.

I understand that the underlying web view may be expensive to create each time, but I kind of don’t have a choice for my situation.

I’m already using a fork of juce so I could definately modify the singleton declaration in juce_win32_WinRTWrapper.h and pass false for doNotRecreateAfterDeletion. Would this be a bad idea? Otherwise, I do not see another way to use the web browser component in a plugin …

Thanks for reporting. We were actually only relying on the WinRT wrapper for its smart COM pointer class and we’ve refactored that out in 48fcea0 to use the existing ComSmartPtr in juce_core. This should fix the issue you’re seeing in your plug-in as we no longer use the wrapper singleton.

Hi @ed95, thanks for the quick response.

I switched to the juce develop branch to test out your changes but I get some build errors.

juce_win32_WebBrowserComponent.cpp(534,68): error C2039: ‘get’: is not a member of 'juce::ComSmartPtr`

Thanks, this has been fixed on develop now.

Thanks @ed95, that did the trick!