fix: BrowserWindow.fromWebContents should work in browser-window-created (#33257)

This commit is contained in:
Jeremy Rose 2022-03-16 16:23:14 -07:00 committed by GitHub
parent b2c5623a13
commit e904486076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -117,11 +117,11 @@ class TrackableObject : public TrackableObjectBase, public EventEmitter<T> {
~TrackableObject() override { RemoveFromWeakMap(); }
void InitWith(v8::Isolate* isolate, v8::Local<v8::Object> wrapper) override {
gin_helper::WrappableBase::InitWith(isolate, wrapper);
if (!weak_map_) {
weak_map_ = new electron::KeyWeakMap<int32_t>;
}
weak_map_->Set(isolate, weak_map_id_, wrapper);
gin_helper::WrappableBase::InitWith(isolate, wrapper);
}
private: