Fixed crash when updating Image.source and BorderImage.source
authorGunnar Sletta <gunnar.sletta@nokia.com>
Thu, 1 Dec 2011 08:42:21 +0000 (09:42 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Dec 2011 08:57:35 +0000 (09:57 +0100)
We need to update the texture pointer in the scene graph node
when the imagedata has changed.

Change-Id: I0246626d3ebb66db9c5cf85fb1c2034ed233984f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>

src/declarative/items/qquickborderimage.cpp
src/declarative/items/qquickimage.cpp

index fac7543..5f30c40 100644 (file)
@@ -592,6 +592,9 @@ void QQuickBorderImage::pixmapChange()
     Q_D(QQuickBorderImage);
 
     d->pixmapChanged = true;
+
+    // When the pixmap changes, such as being deleted, we need to update the textures
+    update();
 }
 
 QT_END_NAMESPACE
index 6d2e1b3..2f924fa 100644 (file)
@@ -703,9 +703,8 @@ void QQuickImage::pixmapChange()
     updatePaintedGeometry();
     d->pixmapChanged = true;
 
-    // Make sure we update the texture provider when the image has changed.
-    if (d->provider)
-        update();
+    // When the pixmap changes, such as being deleted, we need to update the textures
+    update();
 }
 
 QQuickImage::VAlignment QQuickImage::verticalAlignment() const