diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-12-03 04:56:02 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-12-03 04:56:02 -0800 |
commit | f587615e225cc1d172fe35e0dc744c00e929168d (patch) | |
tree | 85c5c361c4ff9bafc818c5ff152656ec9925d7bf /WebCore | |
parent | be33b78f63b17f1b6f5a36a503d797d5f9b941ee (diff) | |
parent | 4cde69e96bdfa8e4abe06985ab19e407696539cf (diff) | |
download | external_webkit-f587615e225cc1d172fe35e0dc744c00e929168d.zip external_webkit-f587615e225cc1d172fe35e0dc744c00e929168d.tar.gz external_webkit-f587615e225cc1d172fe35e0dc744c00e929168d.tar.bz2 |
Merge change I70c3076b into eclair-mr2
* changes:
Fixes a crashing Geolocation bug when a watch is cleared from certain callbacks.
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/page/Geolocation.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index e0352dd..978a1b0 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -87,17 +87,21 @@ void Geolocation::GeoNotifier::timerFired(Timer<GeoNotifier>*) { m_timer.stop(); + // Cache our pointer to the Geolocation object, as this object could be + // deleted by a call to clearWatch in a callback. + Geolocation* geolocation = m_geolocation; + if (m_fatalError) { if (m_errorCallback) m_errorCallback->handleEvent(m_fatalError.get()); // This will cause this notifier to be deleted. - m_geolocation->fatalErrorOccurred(this); + geolocation->fatalErrorOccurred(this); return; } if (m_cachedPosition) { m_successCallback->handleEvent(m_cachedPosition.get()); - m_geolocation->requestReturnedCachedPosition(this); + geolocation->requestReturnedCachedPosition(this); return; } @@ -105,7 +109,7 @@ void Geolocation::GeoNotifier::timerFired(Timer<GeoNotifier>*) RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, "Timeout expired"); m_errorCallback->handleEvent(error.get()); } - m_geolocation->requestTimedOut(this); + geolocation->requestTimedOut(this); } void Geolocation::Watchers::set(int id, PassRefPtr<GeoNotifier> notifier) |