diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-12-13 13:35:42 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-12-13 14:35:32 +0200 |
commit | 642e3fb0d91cca401ebba0221f46bc32fccc1e74 (patch) | |
tree | 7f684b0941c8593b84bf9687ad8093f1b12ccc66 /src | |
parent | 8f358742159ebf151ff8187f1a6d8a05ac5c0207 (diff) |
Fix more valgrind issues
+ some misc fixes
Change-Id: I728da6779bea026d0554d8aae5c00254c3c27694
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
Diffstat (limited to 'src')
6 files changed, 12 insertions, 8 deletions
diff --git a/src/datavisualization/data/qabstract3dseries.cpp b/src/datavisualization/data/qabstract3dseries.cpp index 2c869574..73625328 100644 --- a/src/datavisualization/data/qabstract3dseries.cpp +++ b/src/datavisualization/data/qabstract3dseries.cpp @@ -503,6 +503,7 @@ QAbstract3DSeriesPrivate::QAbstract3DSeriesPrivate(QAbstract3DSeries *q, QAbstra QAbstract3DSeriesPrivate::~QAbstract3DSeriesPrivate() { + delete m_dataProxy; } QAbstractDataProxy *QAbstract3DSeriesPrivate::dataProxy() const diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp index 09fa8510..f2483216 100644 --- a/src/datavisualization/engine/abstract3dcontroller.cpp +++ b/src/datavisualization/engine/abstract3dcontroller.cpp @@ -80,6 +80,7 @@ Abstract3DController::~Abstract3DController() else delete m_renderer; delete m_scene; + delete m_themeManager; } /** diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index 1b436b87..f250fe40 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -65,6 +65,7 @@ Abstract3DRenderer::~Abstract3DRenderer() delete m_drawer; delete m_textureHelper; delete m_cachedScene; + delete m_cachedTheme; } void Abstract3DRenderer::initializeOpenGL() diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index 38e384ad..fec4a7d6 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -302,7 +302,7 @@ void Bars3DRenderer::drawSlicedScene() // Set up projection matrix QMatrix4x4 projectionMatrix; projectionMatrix.perspective(40.0f, (GLfloat)m_sliceViewPort.width() - / (GLfloat)m_sliceViewPort.height(), 0.1f, 10.0f); + / (GLfloat)m_sliceViewPort.height(), 0.1f, 100.0f); // Set view matrix QMatrix4x4 viewMatrix; diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp index 43815d39..bbd50d4e 100644 --- a/src/datavisualization/engine/surface3drenderer.cpp +++ b/src/datavisualization/engine/surface3drenderer.cpp @@ -290,8 +290,11 @@ void Surface3DRenderer::updateSeries(const QList<QAbstract3DSeries *> &seriesLis QVector3D seriesColor = Utils::vectorFromColor(series->baseColor()); if (m_uniformGradientTextureColor != seriesColor) generateUniformGradient(seriesColor); - if (m_selectionPointer) + if (m_selectionPointer) { m_selectionPointer->setHighlightColor(Utils::vectorFromColor(series->singleHighlightColor())); + // Make sure selection pointer object reference is still good + m_selectionPointer->setPointerObject(m_visibleSeriesList.at(0).object()); + } } } @@ -996,7 +999,7 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) m_selectionShader->bind(); glBindFramebuffer(GL_FRAMEBUFFER, m_selectionFrameBuffer); glEnable(GL_DEPTH_TEST); // Needed, otherwise the depth render buffer is not used - glClearColor(0, 0, 0, 0); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Needed for clearing the frame buffer glDisable(GL_DITHER); // disable dithering, it may affect colors if enabled @@ -1016,7 +1019,7 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) glEnable(GL_DITHER); - GLubyte pixel[4] = {0}; + GLubyte pixel[4] = {0, 0, 0, 0}; glReadPixels(m_inputPosition.x(), m_cachedBoundingRect.height() - m_inputPosition.y(), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void *)pixel); diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp index 1ec5fc05..e6f33032 100644 --- a/src/datavisualization/utils/utils.cpp +++ b/src/datavisualization/utils/utils.cpp @@ -131,12 +131,10 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo QVector3D Utils::getSelection(QPoint mousepos, int height) { - QVector3D selectedColor; - //#if defined(QT_OPENGL_ES_2) // This is the only one that works with ANGLE (ES 2.0) // Item count will be limited to 256*256*256 - GLubyte pixel[4]; + GLubyte pixel[4] = {255, 255, 255, 0}; glReadPixels(mousepos.x(), height - mousepos.y(), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, (void *)pixel); @@ -155,7 +153,7 @@ QVector3D Utils::getSelection(QPoint mousepos, int height) // GL_RGB, GL_FLOAT, (void *)pixel3); //qDebug() << "rgba" << pixel3[0] << pixel3[1] << pixel3[2];// << pixel[3]; //#endif - selectedColor = QVector3D(pixel[0], pixel[1], pixel[2]); + QVector3D selectedColor(pixel[0], pixel[1], pixel[2]); //qDebug() << selectedColor; return selectedColor; |