From 13c2161b27c8c94a9ad58391f9d90ba8be26cb58 Mon Sep 17 00:00:00 2001 From: Aesylwinn Date: Tue, 17 May 2016 16:14:23 -0400 Subject: [PATCH] Fix memory leak, remove empty if statement, change dynamic_cast to static_cast --- apps/opencs/view/render/pathgrid.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/opencs/view/render/pathgrid.cpp b/apps/opencs/view/render/pathgrid.cpp index 5c8868344..5b2dd4f98 100644 --- a/apps/opencs/view/render/pathgrid.cpp +++ b/apps/opencs/view/render/pathgrid.cpp @@ -24,7 +24,7 @@ namespace CSVRender virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { - PathgridTag* tag = dynamic_cast(node->getUserData()); + PathgridTag* tag = static_cast(node->getUserData()); tag->getPathgrid()->update(); } }; @@ -44,10 +44,6 @@ namespace CSVRender QString text("Pathgrid: "); text += mPathgrid->getId().c_str(); - if (!hideBasics) - { - } - return text; } @@ -462,7 +458,7 @@ namespace CSVRender if (mPathgridGeometry) { mPathgridGeode->removeDrawable(mPathgridGeometry); - mPathgridGeometry.release(); + mPathgridGeometry = 0; } } @@ -471,7 +467,7 @@ namespace CSVRender if (mSelectedGeometry) { mSelectedGeode->removeDrawable(mSelectedGeometry); - mSelectedGeometry.release(); + mSelectedGeometry = 0; } }