summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/builder/builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/builder/builder.cpp')
-rw-r--r--examples/qt3d/builder/builder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/qt3d/builder/builder.cpp b/examples/qt3d/builder/builder.cpp
index 07078b8d0..2e1db9842 100644
--- a/examples/qt3d/builder/builder.cpp
+++ b/examples/qt3d/builder/builder.cpp
@@ -53,6 +53,7 @@
BuilderView::BuilderView(QWindow *parent)
: QGLView(parent)
, canScene(new QGLSceneNode(this))
+ , texture(0)
{
//! [0]
QGLSceneNode *can = buildGeometry();
@@ -97,6 +98,7 @@ BuilderView::BuilderView(QWindow *parent)
BuilderView::~BuilderView()
{
+ texture->cleanupResources();
delete canScene;
}
@@ -132,6 +134,7 @@ QGLSceneNode *BuilderView::buildGeometry()
url.setPath(QLatin1String(":/images/qt-soup.png"));
url.setScheme(QLatin1String("file"));
mat->setTextureUrl(url);
+ texture = mat->texture();
int canMat = root->palette()->addMaterial(mat);
root->setMaterialIndex(canMat);
root->setEffect(QGL::LitMaterial);