Don't reset handle before Wrappable is destroyed
It is possible that the user wants to use the V8 object in the destructor. Fixes atom/atom-shell#1112.
This commit is contained in:
Родитель
38aba07290
Коммит
40da835cbb
|
@ -176,7 +176,7 @@ class Constructor {
|
|||
}
|
||||
|
||||
base::StringPiece name_;
|
||||
v8::Persistent<v8::FunctionTemplate> constructor_;
|
||||
v8::UniquePersistent<v8::FunctionTemplate> constructor_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Constructor);
|
||||
};
|
||||
|
|
|
@ -112,7 +112,7 @@ class Constructor {
|
|||
}
|
||||
|
||||
base::StringPiece name_;
|
||||
v8::Persistent<v8::FunctionTemplate> constructor_;
|
||||
v8::UniquePersistent<v8::FunctionTemplate> constructor_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Constructor);
|
||||
};
|
||||
|
|
|
@ -57,7 +57,7 @@ class CallbackHolderBase {
|
|||
private:
|
||||
static MATE_WEAK_CALLBACK(WeakCallback, v8::External, CallbackHolderBase);
|
||||
|
||||
v8::Persistent<v8::External> v8_ref_;
|
||||
v8::UniquePersistent<v8::External> v8_ref_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CallbackHolderBase);
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ class CallbackHolderBase {
|
|||
private:
|
||||
static MATE_WEAK_CALLBACK(WeakCallback, v8::External, CallbackHolderBase);
|
||||
|
||||
v8::Persistent<v8::External> v8_ref_;
|
||||
v8::UniquePersistent<v8::External> v8_ref_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CallbackHolderBase);
|
||||
};
|
||||
|
|
|
@ -46,7 +46,6 @@ ObjectTemplateBuilder Wrappable::GetObjectTemplateBuilder(
|
|||
// static
|
||||
MATE_WEAK_CALLBACK(Wrappable::WeakCallback, v8::Object, Wrappable) {
|
||||
MATE_WEAK_CALLBACK_INIT(Wrappable);
|
||||
MATE_PERSISTENT_RESET(self->wrapper_);
|
||||
delete self;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ class Wrappable {
|
|||
private:
|
||||
static MATE_WEAK_CALLBACK(WeakCallback, v8::Object, Wrappable);
|
||||
|
||||
v8::Persistent<v8::Object> wrapper_; // Weak
|
||||
v8::UniquePersistent<v8::Object> wrapper_; // Weak
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Wrappable);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче