aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2011-11-21 14:02:45 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-24 12:46:14 +0100
commitb7be92e8ad22481c79f87e3741f85609c2612be7 (patch)
tree65e600a9ebeef9336a7b6494e6e8b124807e601a
parent43b2d685fbbefd7eb89e4e84af02bc4a4aea86e0 (diff)
Fixed assert during QQuickCanvas::hideEvent().
Also fixed a memory leak in the non-threaded renderer so that it is on par with the threaded one. Change-Id: Ie3111730a9d10085c83f7aafceda240419b722cd Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
-rw-r--r--src/declarative/items/qquickcanvas.cpp20
-rw-r--r--src/declarative/items/qquickcanvas.h1
2 files changed, 3 insertions, 18 deletions
diff --git a/src/declarative/items/qquickcanvas.cpp b/src/declarative/items/qquickcanvas.cpp
index c699a76f06..c6969b5cda 100644
--- a/src/declarative/items/qquickcanvas.cpp
+++ b/src/declarative/items/qquickcanvas.cpp
@@ -166,7 +166,9 @@ public:
maybeUpdate();
}
- virtual void stopRendering() { }
+ virtual void stopRendering() {
+ cleanupNodesOnShutdown();
+ }
virtual void maybeUpdate() {
if (!updatePending) {
@@ -407,8 +409,6 @@ void QQuickCanvasPrivate::initializeSceneGraph()
context->initialize(glctx);
Q_Q(QQuickCanvas);
- QObject::connect(context->renderer(), SIGNAL(sceneGraphChanged()), q, SLOT(maybeUpdate()),
- Qt::DirectConnection);
if (!QQuickItemPrivate::get(rootItem)->itemNode()->parent()) {
context->rootNode()->appendChildNode(QQuickItemPrivate::get(rootItem)->itemNode());
@@ -469,13 +469,6 @@ void QQuickCanvasPrivate::renderSceneGraph(const QSize &size)
}
-// ### Do we need this?
-void QQuickCanvas::sceneGraphChanged()
-{
-// Q_D(QQuickCanvas);
-// d->needsRepaint = true;
-}
-
QQuickCanvasPrivate::QQuickCanvasPrivate()
: rootItem(0)
, activeFocusItem(0)
@@ -852,12 +845,6 @@ QQuickCanvas::~QQuickCanvas()
{
Q_D(QQuickCanvas);
- /* The threaded renderer will clean up the nodes which will fire
- sceneGraphChanged events through back to the canvas. This signal
- is connected to maybeUpdate which should only be called from GUI or during
- updatePaintNode(), so disconnect them before starting the shutdown
- */
- disconnect(d->context->renderer(), SIGNAL(sceneGraphChanged()), this, SLOT(maybeUpdate()));
if (d->thread->isRunning())
d->thread->stopRendering();
@@ -869,7 +856,6 @@ QQuickCanvas::~QQuickCanvas()
delete d->incubationController; d->incubationController = 0;
delete d->rootItem; d->rootItem = 0;
- d->cleanupNodes();
delete d->thread; d->thread = 0;
}
diff --git a/src/declarative/items/qquickcanvas.h b/src/declarative/items/qquickcanvas.h
index 83e3087493..a480439574 100644
--- a/src/declarative/items/qquickcanvas.h
+++ b/src/declarative/items/qquickcanvas.h
@@ -139,7 +139,6 @@ protected:
#endif
private Q_SLOTS:
- void sceneGraphChanged();
void maybeUpdate();
void animationStarted();
void animationStopped();