From d605b97f9acfaf880f88d044144c8ba0b9b467d6 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:30:00 -0400 Subject: [PATCH] fix: missing `HandleScope` in `RemoveFromParentChildWindows` (#46774) fix: missing HandleScope in RemoveFromParentChildWindows Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/api/electron_api_base_window.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 431fc66f9638..46c50732ff62 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -1153,8 +1153,10 @@ void BaseWindow::RemoveFromParentChildWindows() { if (parent_window_.IsEmpty()) return; + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); gin::Handle parent; - if (!gin::ConvertFromV8(isolate(), GetParentWindow(), &parent) || + if (!gin::ConvertFromV8(isolate, GetParentWindow(), &parent) || parent.IsEmpty()) { return; }