From eccbfc77edc4f8b5cbccec2edc43cf5a83f947fc Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 31 Mar 2023 17:49:58 +0100 Subject: [PATCH] browser/app: fix segmentation fault --- src/browser/app.cxx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/browser/app.cxx b/src/browser/app.cxx index c96f021..6f36a71 100644 --- a/src/browser/app.cxx +++ b/src/browser/app.cxx @@ -31,23 +31,12 @@ void Browser::App::OnContextCreated(CefRefPtr browser, CefRefPtrSetValue("identifyAppUrl", CefV8Value::CreateFunction("identifyAppUrl", this->apps[i]), V8_PROPERTY_ATTRIBUTE_READONLY); context->GetGlobal()->SetValue("alt1", alt1, V8_PROPERTY_ATTRIBUTE_READONLY); } else if (frame->IsMain()) { + this->apps[i]->frame = frame; context->GetGlobal()->SetValue("__bolt_app_minify", CefV8Value::CreateFunction("__bolt_app_minify", this->apps[i]), V8_PROPERTY_ATTRIBUTE_READONLY); context->GetGlobal()->SetValue("__bolt_app_settings", CefV8Value::CreateFunction("__bolt_app_settings", this->apps[i]), V8_PROPERTY_ATTRIBUTE_READONLY); context->GetGlobal()->SetValue("__bolt_app_begin_drag", CefV8Value::CreateFunction("__bolt_app_begin_drag", this->apps[i]), V8_PROPERTY_ATTRIBUTE_READONLY); } } - - } - auto it = std::find_if( - this->apps.begin(), - this->apps.end(), - [&browser, &frame](const CefRefPtr& data){ return data->id == browser->GetIdentifier() && frame->GetURL() == data->url; } - ); - if (it != this->apps.end()) { - CefRefPtr alt1 = CefV8Value::CreateObject(nullptr, nullptr); - alt1->SetValue("identifyAppUrl", CefV8Value::CreateFunction("identifyAppUrl", *it), V8_PROPERTY_ATTRIBUTE_READONLY); - // various others here... - context->GetGlobal()->SetValue("alt1", alt1, V8_PROPERTY_ATTRIBUTE_READONLY); } }