From f756a3e682ec3f0fa111c768f7535c5caa5387d1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 23 May 2016 17:03:49 +0900 Subject: [PATCH] Fix crash when quitting --- atom/browser/api/trackable_object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/trackable_object.h b/atom/browser/api/trackable_object.h index a5ed593a6ba6..bbed54754002 100644 --- a/atom/browser/api/trackable_object.h +++ b/atom/browser/api/trackable_object.h @@ -113,7 +113,7 @@ class TrackableObject : public TrackableObjectBase, void AfterInit(v8::Isolate* isolate) override { if (!weak_map_) { - weak_map_.reset(new atom::KeyWeakMap); + weak_map_ = new atom::KeyWeakMap; } weak_map_id_ = ++next_id_; weak_map_->Set(isolate, weak_map_id_, Wrappable::GetWrapper()); @@ -123,7 +123,7 @@ class TrackableObject : public TrackableObjectBase, private: static int32_t next_id_; - static std::unique_ptr> weak_map_; + static atom::KeyWeakMap* weak_map_; // leaked on purpose DISALLOW_COPY_AND_ASSIGN(TrackableObject); }; @@ -132,7 +132,7 @@ template int32_t TrackableObject::next_id_ = 0; template -std::unique_ptr> TrackableObject::weak_map_; +atom::KeyWeakMap* TrackableObject::weak_map_ = nullptr; } // namespace mate