Author: [EMAIL PROTECTED]
Date: Mon Nov 10 06:36:03 2008
New Revision: 725
Modified:
branches/bleeding_edge/src/global-handles.cc
Log:
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
Modified: branches/bleeding_edge/src/global-handles.cc
==============================================================================
--- branches/bleeding_edge/src/global-handles.cc (original)
+++ branches/bleeding_edge/src/global-handles.cc Mon Nov 10 06:36:03 2008
@@ -96,6 +96,7 @@
// 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 @@
void ClearWeakness() {
LOG(HandleEvent("GlobalHandle::ClearWeakness", handle().location()));
+ ASSERT(state_ != DESTROYED);
if (state_ == WEAK || IsNearDeath()) {
GlobalHandles::number_of_weak_handles_--;
if (object_->IsJSGlobalObject()) {
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---