Changeset 57818 in webkit
- Timestamp:
- Apr 19, 2010 11:00:58 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57817 r57818 1 2010-04-19 Balazs Kelemen <kb@inf.u-szeged.hu> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Destroy SharedTimerQt before destruction of QCoreApplication. 6 7 To avoid unsafe situations caused by running WebCore code (through firing timers) when destruction of QCoreApplication 8 has been started, we should explicitly destroy the SharedTimerQt instance on application exit. 9 We can achieve that through installing a self-destroying slot for the QCoreApplication::aboutToQuit() signal 10 into the SharedTimerQt instance. 11 12 https://bugs.webkit.org/show_bug.cgi?id=36832 13 14 No functional change so no new tests. 15 16 * platform/qt/SharedTimerQt.cpp: 17 (WebCore::SharedTimerQt::SharedTimerQt): 18 (WebCore::SharedTimerQt::destroy): 19 (WebCore::SharedTimerQt::inst): 20 1 21 2010-04-19 Dan Bernstein <mitz@apple.com> 2 22 -
trunk/WebCore/platform/qt/SharedTimerQt.cpp
r40160 r57818 41 41 42 42 class SharedTimerQt : public QObject { 43 Q_OBJECT 44 43 45 friend void setSharedTimerFiredFunction(void (*f)()); 44 46 public: … … 51 53 void timerEvent(QTimerEvent* ev); 52 54 55 private slots: 56 void destroy(); 57 53 58 private: 54 SharedTimerQt( QObject* parent);59 SharedTimerQt(); 55 60 ~SharedTimerQt(); 56 61 QBasicTimer m_timer; … … 58 63 }; 59 64 60 SharedTimerQt::SharedTimerQt( QObject* parent)61 : QObject( parent)65 SharedTimerQt::SharedTimerQt() 66 : QObject() 62 67 , m_timerFunction(0) 63 68 {} … … 69 74 } 70 75 76 void SharedTimerQt::destroy() 77 { 78 delete this; 79 } 80 71 81 SharedTimerQt* SharedTimerQt::inst() 72 82 { 73 83 static QPointer<SharedTimerQt> timer; 74 if (!timer) 75 timer = new SharedTimerQt(QCoreApplication::instance()); 84 if (!timer) { 85 timer = new SharedTimerQt(); 86 timer->connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(destroy())); 87 } 76 88 77 89 return timer; … … 130 142 } 131 143 144 #include "SharedTimerQt.moc" 145 132 146 } 133 147
Note: See TracChangeset
for help on using the changeset viewer.