Skip to content

Conversation

@shagye
Copy link
Contributor

@shagye shagye commented Jan 23, 2026

I developed a Qt GUI that acts as a plugin manager. In this application, when I rapidly load and unload a class implemented using qcefview, an exception is thrown inside the destroyCefBrowser() function.

By “rapidly,” I mean the following scenario: during the first initialization, the CEF library appears to asynchronously create a web context and its internal threads in the background. In other words, when a QCefView instance is created, this background initialization process has not yet fully completed. However, if I assume that the browser is already fully created and immediately call the destructor, ncw.qBrowserWidget ends up being nullptr.

I encountered this issue while testing edge cases in my system. If I activate the plugin and then deactivate it very quickly (for example, after about 0.2 seconds), the problem occurs. However, if I activate the plugin, wait for a certain amount of time (approximately 1.5 seconds), and then deactivate it, no issue occurs. Additionally, after the first successful initialization, even if I rapidly close and reopen the plugin, the problem no longer appears.

I should also mention that in my UI, it is not possible to remove or deactivate a plugin before it has been loaded. In other words, deactivation is only possible after the QCefView constructor has completed. Despite this, the issue still occurs, which suggests that although the constructor finishes, the internal CEF browser creation is still ongoing asynchronously.

Copy link
Member

@tishion tishion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reasonable safety check.

@tishion tishion merged commit f3c67ae into CefView:main Jan 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants