diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-03-09 09:26:57 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-09 09:26:57 -0800 |
commit | 615fcf00641400b4851396f3ac5525818c4aa33a (patch) | |
tree | c482066111b7e73816171bcfd1e4c4a3dd6657fc | |
parent | d9fa508e3486607d040245aac43aa3f60e761a03 (diff) | |
parent | d1f25a8a55bba56cdfbe6275a04028e5f85d6bda (diff) | |
download | external_webkit-615fcf00641400b4851396f3ac5525818c4aa33a.zip external_webkit-615fcf00641400b4851396f3ac5525818c4aa33a.tar.gz external_webkit-615fcf00641400b4851396f3ac5525818c4aa33a.tar.bz2 |
Merge "Prevent double deletion when timer callback causes plugin to be deleted." into honeycomb-mr1
-rw-r--r-- | WebKit/android/plugins/PluginTimer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/WebKit/android/plugins/PluginTimer.cpp b/WebKit/android/plugins/PluginTimer.cpp index 9ed6a80..dfa7272 100644 --- a/WebKit/android/plugins/PluginTimer.cpp +++ b/WebKit/android/plugins/PluginTimer.cpp @@ -71,7 +71,12 @@ namespace WebCore { if (!m_unscheduled) m_timerFunc(m_instance, m_timerID); - if (!m_repeat || m_unscheduled) + // remove the timer if it is a one-shot timer (!m_repeat) or if is a + // repeating timer that has been unscheduled. In either case we must + // ensure that the refcount is 2 or greater since the PluginTimerList + // could have been deleted by the timerFunc and we must ensure that we + // do not double delete. + if ((!m_repeat || m_unscheduled) && refCount() > 1) deref(); // mark the timer for deletion as it is no longer needed } |