app: delete window.close()

window.close() is completely broken in CEF, it destroys the browser and
calls OnBeforeClose before calling CanClose, which generally leads to
segmentation faults no matter how you handle it. So don't use it. Close
via the Bolt API instead.
This commit is contained in:
Adam
2024-10-18 21:08:24 +01:00
parent 8e5ea8dae4
commit 260a0fe202

View File

@@ -43,7 +43,9 @@ void Browser::App::OnBrowserCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<Cef
}
void Browser::App::OnContextCreated(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) {
context->GetGlobal()->SetValue("s", CefV8Value::CreateFunction("s", this), V8_PROPERTY_ATTRIBUTE_READONLY);
const CefRefPtr<CefV8Value> global = context->GetGlobal();
global->SetValue("s", CefV8Value::CreateFunction("s", this), V8_PROPERTY_ATTRIBUTE_READONLY);
global->SetValue("close", CefV8Value::CreateUndefined(), V8_PROPERTY_ATTRIBUTE_READONLY);
}
void Browser::App::OnUncaughtException(