Changeset 59057 in webkit
- Timestamp:
- May 9, 2010 9:37:25 AM (14 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qgraphicswebview.cpp
r58877 r59057 83 83 , resizesToContents(false) 84 84 #if USE(ACCELERATED_COMPOSITING) 85 , rootGraphicsLayer(0)86 85 , shouldSync(false) 87 86 #endif … … 159 158 160 159 #if USE(ACCELERATED_COMPOSITING) 161 Q GraphicsItem*rootGraphicsLayer;160 QWeakPointer<QGraphicsObject> rootGraphicsLayer; 162 161 // we need to sync the layers if we get a special call from the WebCore 163 162 // compositor telling us to do so. We'll get that call from ChromeClientQt … … 172 171 { 173 172 #if USE(ACCELERATED_COMPOSITING) 174 if (rootGraphicsLayer) { 175 // we don't need to delete the root graphics layer 176 // The lifecycle is managed in GraphicsLayerQt.cpp 177 rootGraphicsLayer->setParentItem(0); 178 q->scene()->removeItem(rootGraphicsLayer); 179 } 173 if (!rootGraphicsLayer) 174 return; 175 // we don't need to delete the root graphics layer. The lifecycle is managed in GraphicsLayerQt.cpp. 176 rootGraphicsLayer.data()->setParentItem(0); 177 q->scene()->removeItem(rootGraphicsLayer.data()); 180 178 #endif 181 179 } … … 205 203 { 206 204 if (rootGraphicsLayer) { 207 rootGraphicsLayer ->setParentItem(0);208 q->scene()->removeItem(rootGraphicsLayer );205 rootGraphicsLayer.data()->setParentItem(0); 206 q->scene()->removeItem(rootGraphicsLayer.data()); 209 207 QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive(); 210 208 } 211 209 212 rootGraphicsLayer = layer ;210 rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0; 213 211 214 212 if (layer) { … … 232 230 if (rootGraphicsLayer && q->page() && q->page()->mainFrame()) { 233 231 const QPoint scrollPosition = q->page()->mainFrame()->scrollPosition(); 234 rootGraphicsLayer ->setPos(-scrollPosition);232 rootGraphicsLayer.data()->setPos(-scrollPosition); 235 233 } 236 234 } -
trunk/WebKit/qt/ChangeLog
r59033 r59057 1 2010-05-09 Noam Rosenthal <noam.rosenthal@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Crash in QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate when animation were used 6 https://bugs.webkit.org/show_bug.cgi?id=38574 7 8 The fix uses a QWeakPointer for rootGraphicsLayer, protecting from a crash in case the layer is deleted before the QGraphicsWebView. 9 10 * Api/qgraphicswebview.cpp: 11 (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): 12 (QGraphicsWebViewPrivate::~QGraphicsWebViewPrivate): 13 (QGraphicsWebViewPrivate::setRootGraphicsLayer): 14 (QGraphicsWebViewPrivate::updateCompositingScrollPosition): 15 1 16 2010-05-08 Luiz Agostini <luiz.agostini@openbossa.org> 2 17
Note: See TracChangeset
for help on using the changeset viewer.