Redo previous patch http://trac.webkit.org/changeset/34260 which fixes a
authortreat@webkit.org <treat@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2009 15:02:38 +0000 (15:02 +0000)
committertreat@webkit.org <treat@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2009 15:02:38 +0000 (15:02 +0000)
huge memory leak by ensuring that the timer is fired one last time on
application tear down thus triggering the GCController thereby freeing
JavaScript objects as well as triggering other timer based tear down methods.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/SharedTimerQt.cpp

index b3dedd0..9d31fe6 100644 (file)
@@ -1,3 +1,15 @@
+2009-01-23  Adam Treat  <adam.treat@torchmobile.com>
+
+        Reviewed by Holger Hans Peter Freyther.
+
+        Redo previous patch http://trac.webkit.org/changeset/34260 which fixes a
+        huge memory leak by ensuring that the timer is fired one last time on
+        application tear down thus triggering the GCController thereby freeing
+        JavaScript objects as well as triggering other timer based tear down methods.
+
+        * platform/qt/SharedTimerQt.cpp:
+        (WebCore::SharedTimerQt::~SharedTimerQt):
+
 2009-01-23  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Oliver Hunt.
index 60b47f6..e9bcaee 100644 (file)
@@ -52,6 +52,7 @@ protected:
 
 private:
     SharedTimerQt(QObject* parent);
+    ~SharedTimerQt();
     QBasicTimer m_timer;
     void (*m_timerFunction)();
 };
@@ -61,6 +62,12 @@ SharedTimerQt::SharedTimerQt(QObject* parent)
     , m_timerFunction(0)
 {}
 
+SharedTimerQt::~SharedTimerQt()
+{
+    if (m_timer.isActive())
+        (m_timerFunction)();
+}
+
 SharedTimerQt* SharedTimerQt::inst()
 {
     static QPointer<SharedTimerQt> timer;