summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/WeakGCPtr.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/WeakGCPtr.h')
-rw-r--r--JavaScriptCore/runtime/WeakGCPtr.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/JavaScriptCore/runtime/WeakGCPtr.h b/JavaScriptCore/runtime/WeakGCPtr.h
index 8653721..3ed4645 100644
--- a/JavaScriptCore/runtime/WeakGCPtr.h
+++ b/JavaScriptCore/runtime/WeakGCPtr.h
@@ -44,7 +44,11 @@ public:
return m_ptr;
}
- void clear() { m_ptr = 0; }
+ void clear(JSCell* ptr)
+ {
+ if (ptr == m_ptr)
+ m_ptr = 0;
+ }
T& operator*() const { return *get(); }
T* operator->() const { return get(); }