Index: Source/WebCore/bindings/v8/NPV8Object.cpp |
=================================================================== |
--- Source/WebCore/bindings/v8/NPV8Object.cpp (revision 136064) |
+++ Source/WebCore/bindings/v8/NPV8Object.cpp (working copy) |
@@ -80,16 +80,17 @@ |
int v8ObjectHash = v8NpObject->v8Object->GetIdentityHash(); |
ASSERT(v8ObjectHash); |
V8NPObjectMap::iterator iter = v8NPObjectMap->find(v8ObjectHash); |
- ASSERT(iter != v8NPObjectMap->end()); |
- V8NPObjectVector& objects = iter->value; |
- for (size_t index = 0; index < objects.size(); ++index) { |
- if (objects.at(index) == v8NpObject) { |
- objects.remove(index); |
- break; |
+ if (iter != v8NPObjectMap->end()) { |
+ V8NPObjectVector& objects = iter->value; |
+ for (size_t index = 0; index < objects.size(); ++index) { |
+ if (objects.at(index) == v8NpObject) { |
+ objects.remove(index); |
+ break; |
+ } |
} |
+ if (objects.isEmpty()) |
+ v8NPObjectMap->remove(v8ObjectHash); |
} |
- if (objects.isEmpty()) |
- v8NPObjectMap->remove(v8ObjectHash); |
} |
v8NpObject->v8Object.Dispose(); |
free(v8NpObject); |