diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-02-20 14:21:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-20 19:41:44 +0100 |
commit | 8c8404f8153508106f65efb43110ba85c05e73bc (patch) | |
tree | 100690675de9ac65f9026269187ac63f81070805 /src/quick/scenegraph/util/qsgtexture.cpp | |
parent | bbc9008f077bccd811483608d9a436cce3e923f5 (diff) |
Don't print leak warnings on exit by default
Task-number: QTBUG-29780
Change-Id: I6f35253dbec6346af239c0ab341caad9f4f9b862
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/quick/scenegraph/util/qsgtexture.cpp')
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 87ef91b212..48927ce5e1 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -65,6 +65,10 @@ #include <QHash> #endif +#ifndef QT_NO_DEBUG +static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty(); +#endif + #ifndef QSG_NO_RENDERER_TIMING static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty(); static QElapsedTimer qsg_renderer_timer; @@ -182,7 +186,7 @@ static void qt_debug_remove_texture(QSGTexture* texture) --qt_debug_texture_count; if (qt_debug_texture_count < 0) - qDebug("Material destroyed after qt_debug_print_texture_count() was called."); + qDebug("Texture destroyed after qt_debug_print_texture_count() was called."); } #endif // QT_NO_DEBUG @@ -269,7 +273,8 @@ QSGTexture::QSGTexture() : QObject(*(new QSGTexturePrivate)) { #ifndef QT_NO_DEBUG - qt_debug_add_texture(this); + if (qsg_leak_check) + qt_debug_add_texture(this); #endif } @@ -279,7 +284,8 @@ QSGTexture::QSGTexture() QSGTexture::~QSGTexture() { #ifndef QT_NO_DEBUG - qt_debug_remove_texture(this); + if (qsg_leak_check) + qt_debug_remove_texture(this); #endif } |