mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: app.dock.setIcon() crash before app ready (#36279)
fix: dock.setIcon() crash before app ready
This commit is contained in:
@@ -447,6 +447,13 @@ void Browser::DockSetIcon(v8::Isolate* isolate, v8::Local<v8::Value> icon) {
|
|||||||
image = native_image->image();
|
image = native_image->image();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is needed when this fn is called before the browser
|
||||||
|
// process is ready, since supported scales are normally set
|
||||||
|
// by ui::ResourceBundle::InitSharedInstance
|
||||||
|
// during browser process startup.
|
||||||
|
if (!is_ready())
|
||||||
|
gfx::ImageSkia::SetSupportedScales({1.0f});
|
||||||
|
|
||||||
[[AtomApplication sharedApplication]
|
[[AtomApplication sharedApplication]
|
||||||
setApplicationIconImage:image.AsNSImage()];
|
setApplicationIconImage:image.AsNSImage()];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user