v0.12.3 Guarantee thread safety by citkane · Pull Request #1311 · webview/webview
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 1.1k
Conversation
This release guarantees thread safety, thus simplifying the public API and providing the user a cleaner approach to building Webview based applications.
Changed
- Webview automatically detects if the thread context is
main, and internally re-directs API calls todispatch_implappropriately. - Webview class initialisation MUST happen on the
mainthread, and Webview will now throw an exception if not. runandinitSHOULD be called on themainthread, and Webview will now return an error if not.- The Webview headers are now built with
Threads::Threadsas a dependency. - Windows CI tests have
pthreadstatically linked, else MSVC builds will fail to resolve threading library paths. - Windows CI warmup test uses std::thread to check linkages.
Deprecated
webview_dispatchis no longer needed due to guaranteed thread safety. The user can make API calls freely from any context.webview_destroy. The legacy implementation of this API function was in violation of RAII, and likely to cause undefined behaviour. From a user perspective, it is ambiguous and easily confused withwebview_terminate. It now safely re-directs itself towebview_terminateand is no-op if called afterwebview_terminateorwebview_run.
Depends on PR's
This was referenced
Jun 18, 2025This was referenced
Jun 18, 2025This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters