Changeset 65795 in webkit
- Timestamp:
- Aug 23, 2010 12:59:48 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65793 r65795 1 2010-08-23 Ariya Hidayat <ariya@sencha.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Crash when purging the scratch buffer for the shadow 6 https://bugs.webkit.org/show_bug.cgi?id=44384 7 8 WebCore::Timer can't be used in a static object bcause it relies on 9 thread global data, which is invalid once the application instance is 10 destroyed. To overcome the problem, use QObject's timer support for 11 the ShadowBuffer class. 12 13 * platform/graphics/qt/ContextShadow.cpp: 14 (WebCore::): 15 (WebCore::ShadowBuffer::ShadowBuffer): 16 (WebCore::ShadowBuffer::schedulePurge): 17 (WebCore::ShadowBuffer::timerEvent): 18 1 19 2010-08-23 Philippe Normand <pnormand@igalia.com> 2 20 -
trunk/WebCore/platform/graphics/qt/ContextShadow.cpp
r65782 r65795 29 29 #include "ContextShadow.h" 30 30 31 #include "Timer.h"31 #include <QTimerEvent> 32 32 #include <wtf/Noncopyable.h> 33 33 … … 38 38 // we create a buffer which will be automatically purged via a timer. 39 39 40 class ShadowBuffer: public Noncopyable{40 class ShadowBuffer: public QObject { 41 41 public: 42 ShadowBuffer( );42 ShadowBuffer(QObject* parent = 0); 43 43 44 44 QImage* scratchImage(const QSize& size); 45 45 46 46 void schedulePurge(); 47 48 protected: 49 void timerEvent(QTimerEvent* event); 47 50 48 51 private: 49 52 QImage image; 50 void purgeBuffer(Timer<ShadowBuffer>*); 51 Timer<ShadowBuffer> purgeTimer; 53 int timerId; 52 54 }; 53 55 54 ShadowBuffer::ShadowBuffer() 55 : purgeTimer(this, &ShadowBuffer::purgeBuffer) 56 ShadowBuffer::ShadowBuffer(QObject* parent) 57 : QObject(parent) 58 , timerId(0) 56 59 { 57 60 } … … 85 88 { 86 89 static const double BufferPurgeDelay = 2; // seconds 87 purgeTimer.startOneShot(BufferPurgeDelay); 88 } 89 90 void ShadowBuffer::purgeBuffer(Timer<ShadowBuffer>*) 91 { 92 image = QImage(); 90 killTimer(timerId); 91 timerId = startTimer(BufferPurgeDelay * 1000); 92 } 93 94 void ShadowBuffer::timerEvent(QTimerEvent* event) 95 { 96 if (event->timerId() == timerId) { 97 killTimer(timerId); 98 image = QImage(); 99 } 100 QObject::timerEvent(event); 93 101 } 94 102
Note: See TracChangeset
for help on using the changeset viewer.