Changeset 53441 in webkit
- Timestamp:
- Jan 18, 2010 5:05:47 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53439 r53441 1 2010-01-18 Steve Falkenburg <sfalken@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 <https://bugs.webkit.org/show_bug.cgi?id=33816> 6 Crashes in Geolocation code due to refcounting, observer balance issues. 7 8 Hold a ref to the GeoNotifier while dispatching a callback. The code was 9 copying a data member to avoid accessing a freed this ptr, but was still 10 using the this ptr. 11 12 Geolocation::removeObserver calls are not always balanced with addObserver. 13 Instead of asserting and continuing, don't try to remove non-existant 14 observers. 15 16 * page/Geolocation.cpp: 17 (WebCore::Geolocation::GeoNotifier::timerFired): Protect notifier. 18 * page/GeolocationController.cpp: 19 (WebCore::GeolocationController::removeObserver): Change ASSERT into an if with early return. 20 1 21 2010-01-18 Alexey Proskuryakov <ap@apple.com> 2 22 -
trunk/WebCore/page/Geolocation.cpp
r53342 r53441 108 108 m_timer.stop(); 109 109 110 // Cache our pointer to the Geolocation object, as this GeoNotifier object110 // Protect this GeoNotifier object, since it 111 111 // could be deleted by a call to clearWatch in a callback. 112 Geolocation* geolocation = m_geolocation;112 RefPtr<GeoNotifier> protect(this); 113 113 114 114 if (m_fatalError) { … … 116 116 m_errorCallback->handleEvent(m_fatalError.get()); 117 117 // This will cause this notifier to be deleted. 118 geolocation->fatalErrorOccurred(this);118 m_geolocation->fatalErrorOccurred(this); 119 119 return; 120 120 } … … 124 124 m_errorCallback->handleEvent(error.get()); 125 125 } 126 geolocation->requestTimedOut(this);126 m_geolocation->requestTimedOut(this); 127 127 } 128 128 -
trunk/WebCore/page/GeolocationController.cpp
r52103 r53441 55 55 void GeolocationController::removeObserver(Geolocation* observer) 56 56 { 57 ASSERT(m_observers.contains(observer)); 57 if (!m_observers.contains(observer)) 58 return; 58 59 59 60 m_observers.remove(observer);
Note: See TracChangeset
for help on using the changeset viewer.