Commit a0074eea authored by eric@webkit.org's avatar eric@webkit.org

2009-09-17 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        [V8] OwnHandle might get a weak callback after destruction
        https://bugs.webkit.org/show_bug.cgi?id=29172

        Be sure to clear out weak reference so we don't get a weak callback
        after we've destructed ourselves.  Also, removed some tricky methods
        that had no clients.

        * bindings/v8/OwnHandle.h:
        (WebCore::OwnHandle::clear):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7c91b19a
2009-09-17 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
[V8] OwnHandle might get a weak callback after destruction
https://bugs.webkit.org/show_bug.cgi?id=29172
Be sure to clear out weak reference so we don't get a weak callback
after we've destructed ourselves. Also, removed some tricky methods
that had no clients.
* bindings/v8/OwnHandle.h:
(WebCore::OwnHandle::clear):
2009-09-17 Dimitri Glazkov <dglazkov@chromium.org>
Unreviewed, build fix.
......@@ -45,15 +45,13 @@ namespace WebCore {
v8::Handle<T> get() const { return m_handle; }
void set(v8::Handle<T> handle) { clear(); m_handle = v8::Persistent<T>::New(handle); }
// FIXME: What if we release a weak handle? Won't the callback do the wrong thing?
v8::Persistent<T> release() { v8::Persistent<T> result = m_handle; m_handle.Clear(); return result; }
void adopt(v8::Persistent<T> handle) { clear(); m_handle = handle; }
// Note: This is clear in the OwnPtr sense, not the v8::Handle sense.
void clear()
{
if (m_handle.IsEmpty())
return;
if (m_handle.IsWeak())
m_handle.ClearWeak();
m_handle.Dispose();
m_handle.Clear();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment