You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.6: Addendum to 2e56bd0 & ec248d4: Further improve CEF implementation, and fix any bugs encountered along the way.
-- NOTE: Different code in SharedUtil.Misc.hpp due to 1.6 backport (C++ 14 constraint)
Fixes CEF freeze (between reconnects) introduced by ec248d4 as well, e.g:
ERROR: [browser_info_manager.cc] Timeout of new browser info response for frame [id] (has_rfh=1)
Regarding the directly above, about the added safety checks;
Especially needed now that the Initialise() return logic changed. Previously, on initialization fail, it would leave CEF in a partial state.
The new code now properly returns false and cleans up m_pWebCore.
Before (buggy code):
When Initialise() failed, the code deleted m_pWebCore with SAFE_DELETE
Next call to GetWebCore() created a new CWebCore and call CefInitialize() again
Problem: CEF only allows calling CefInitialize() ONCE per process - second call causes freeze
After (fixed code):
Initialise() stores the result in m_bInitialised flag
m_pWebCore is NEVER deleted, even if initialization fails
Added IsInitialised() method that returns the m_bInitialised flag
What this means for callers (Hence all the new checks being added now):
- GetWebCore() can now return a non-null pointer that is not usable.
Before: If you got a pointer back from GetWebCore(), it was always safe to use
After: You need to check if the pointer is nullptr because we now return nullptr when initialization failed
Example:
IsWebCoreLoaded() now checks both that the pointer exists AND that CEF initialized successfully
Every caller of GetWebCore() needs to handle nullptr return value
Every method in CClientWebBrowser needs to check m_pWebView ins't null before using it
0 commit comments