Destroyed global handles should not be touched. Added extra
assertions to get errors when first touching the destroyed handle instead of getting the error when allocating a new handle at some later point. Review URL: http://codereview.chromium.org/9741 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
2889b1ea86
commit
cc055d2dee
@ -96,6 +96,7 @@ class GlobalHandles::Node : public Malloced {
|
||||
// Make this handle weak.
|
||||
void MakeWeak(void* parameter, WeakReferenceCallback callback) {
|
||||
LOG(HandleEvent("GlobalHandle::MakeWeak", handle().location()));
|
||||
ASSERT(state_ != DESTROYED);
|
||||
if (state_ != WEAK && !IsNearDeath()) {
|
||||
GlobalHandles::number_of_weak_handles_++;
|
||||
if (object_->IsJSGlobalObject()) {
|
||||
@ -109,6 +110,7 @@ class GlobalHandles::Node : public Malloced {
|
||||
|
||||
void ClearWeakness() {
|
||||
LOG(HandleEvent("GlobalHandle::ClearWeakness", handle().location()));
|
||||
ASSERT(state_ != DESTROYED);
|
||||
if (state_ == WEAK || IsNearDeath()) {
|
||||
GlobalHandles::number_of_weak_handles_--;
|
||||
if (object_->IsJSGlobalObject()) {
|
||||
|
Loading…
Reference in New Issue
Block a user