Changeset 86498 in webkit
- Timestamp:
- May 14, 2011 2:44:33 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86491 r86498 1 2011-05-14 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Make Qt bindings GC safe 6 https://bugs.webkit.org/show_bug.cgi?id=60841 7 8 Trying to do cache management by using "this" as a key from a GC 9 object's destructor leads to a violation of GC semantics. Make 10 the qt bindings use a Weak<> handle for finalization. 11 12 * bridge/qt/qt_runtime.cpp: 13 (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): 14 (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod): 15 * bridge/qt/qt_runtime.h: 16 (JSC::Bindings::QtRuntimeMethodData::finalize): 17 1 18 2011-05-14 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r84556 r86498 988 988 QW_D(QtRuntimeMethod); 989 989 d->m_instance = inst; 990 d->m_finalizer.set(exec->globalData(), this, d); 990 991 } 991 992 992 993 QtRuntimeMethod::~QtRuntimeMethod() 993 994 { 994 QW_D(QtRuntimeMethod);995 d->m_instance->removeCachedMethod(this);996 995 delete d_ptr; 997 996 } … … 1001 1000 QtRuntimeMethodData::~QtRuntimeMethodData() 1002 1001 { 1002 } 1003 1004 void QtRuntimeMethodData::finalize(Handle<Unknown> value, void*) 1005 { 1006 m_instance->removeCachedMethod(static_cast<JSObject*>(value.get().asCell())); 1003 1007 } 1004 1008 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r84556 r86498 24 24 #include "Completion.h" 25 25 #include "Strong.h" 26 #include "Weak.h" 26 27 #include "runtime_method.h" 27 28 … … 116 117 117 118 // Extra data classes (to avoid the CELL_SIZE limit on JS objects) 118 119 class QtRuntimeMethodData {119 class QtRuntimeMethod; 120 class QtRuntimeMethodData : public WeakHandleOwner { 120 121 public: 121 122 virtual ~QtRuntimeMethodData(); 122 123 RefPtr<QtInstance> m_instance; 124 Weak<QtRuntimeMethod> m_finalizer; 125 126 private: 127 void finalize(Handle<Unknown>, void*); 123 128 }; 124 129
Note: See TracChangeset
for help on using the changeset viewer.