summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSergey Dubitskiy <sergey.dubitskiy@nokia.com>2012-02-10 15:20:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-12 02:41:24 +0100
commit2c29c501e5ee2aeab9371f7923c888fb6658e5ef (patch)
tree95c4a88d816d5c8e76e6ff3eb94225192a2c4897 /src/plugins
parentce825d290887afab95731b7bcb48256ba211ebd3 (diff)
Task: Resource handling needs refactoring.
Phase One: 1. fixed lots of memory leaks related to Texture2D's not being deleted. 2. Texture2D now prints warning in destructor, if cleanupResources() was not properly called before. Task-number: QTBUG-24043 Change-Id: Ia6a8bbe38ad66778a38705e0a4464f24373d8846 Reviewed-by: Danny Pope <daniel.pope@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sceneformats/assimp/qailoader.cpp3
-rw-r--r--src/plugins/sceneformats/assimp/qaiscene.cpp1
-rw-r--r--src/plugins/sceneformats/assimp/qaiscenehandler.cpp3
3 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/sceneformats/assimp/qailoader.cpp b/src/plugins/sceneformats/assimp/qailoader.cpp
index d8882c512..c8b2cd2cd 100644
--- a/src/plugins/sceneformats/assimp/qailoader.cpp
+++ b/src/plugins/sceneformats/assimp/qailoader.cpp
@@ -481,7 +481,6 @@ void QAiLoader::loadTextures(aiMaterial *ma, QGLMaterial *mq)
*/
void QAiLoader::loadMaterial(aiMaterial *ma)
{
- QGLMaterialCollection *palette = m_builder.palette();
QGLMaterial *mq = new QGLMaterial;
mq->setObjectName("___DEFAULT_NAME___");
@@ -548,7 +547,7 @@ void QAiLoader::loadMaterial(aiMaterial *ma)
//
// executive summary: don't muck around with the palettte outside of this call
- int k = palette->addMaterial(mq);
+ int k = m_builder.palette()->addMaterial(mq);
Q_UNUSED(k);
//qDebug() << "loaded material" << k << mq;
diff --git a/src/plugins/sceneformats/assimp/qaiscene.cpp b/src/plugins/sceneformats/assimp/qaiscene.cpp
index cdf1ac49f..c1de1282f 100644
--- a/src/plugins/sceneformats/assimp/qaiscene.cpp
+++ b/src/plugins/sceneformats/assimp/qaiscene.cpp
@@ -69,6 +69,7 @@ QAiScene::QAiScene(const aiScene *scene, QAiSceneHandler *handler)
Q_ASSERT(scene);
QAiLoader loader(scene, handler);
m_root = loader.loadMeshes();
+ m_root->setParent(this);
m_animations = loader.loadAnimations();
}
diff --git a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp b/src/plugins/sceneformats/assimp/qaiscenehandler.cpp
index ff16ee1b5..c24b430fd 100644
--- a/src/plugins/sceneformats/assimp/qaiscenehandler.cpp
+++ b/src/plugins/sceneformats/assimp/qaiscenehandler.cpp
@@ -215,9 +215,6 @@ void QAiSceneHandler::decodeOptions(const QString &options)
QGLAbstractScene *QAiSceneHandler::read()
{
- qDebug() << "QAiSceneHandler::read()";
-
-
AiLoaderIOSystem *ios = new AiLoaderIOSystem(device(), url());
m_importer.SetIOHandler(ios);