Import 2017-06-07 23:51:09: master 5ed5ba23

Author Committer Branch Timestamp Parent
jcfr jcfr master 2015-07-17 02:51:14 master f698ed7f
Changeset

BUG: Fix memory leak in vtkMRMLScene

This commit fixes the error(s) reported below by valgrind memcheck tool.

Valgrind was used on Ubuntu 14.04 against a Debug build of Slicer. It was
executed doing the following:
(1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
(2) Run vtkMRMLSceneImportIDModelHierarchyConflictTest using using valgrind: valgrind --tool=memcheck --leak-check=yes ./bin/MRMLCoreCxxTests vtkMRMLSceneImportIDModelHierarchyConflictTest

Valgrind error:

==17319== 18 bytes in 2 blocks are definitely lost in loss record 98 of 240
==17319== at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17319== by 0x52DAB7D: vtkMRMLScene::SetLastLoadedVersion(char const) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==17319== by 0x52A9C29: vtkMRMLParser::StartElement(char const
, char const*) (vtkMRMLParser.cxx:47)
==17319== by 0x1A9BAC12: vtkXMLParserStartElement (vtkXMLParser.cxx:523)
==17319== by 0x1BE5A943: doContent (xmlparse.c:1641)
==17319== by 0x1BE59A10: contentProcessor (xmlparse.c:1331)
==17319== by 0x1BE5DCEF: doProlog (xmlparse.c:2669)
==17319== by 0x1BE5D48F: prologProcessor (xmlparse.c:2505)
==17319== by 0x1BE5D41C: prologInitProcessor (xmlparse.c:2494)
==17319== by 0x1BE592C2: vtk_expat_XML_ParseBuffer (xmlparse.c:1132)
==17319== by 0x1BE59218: vtk_expat_XML_Parse (xmlparse.c:1122)
==17319== by 0x1A9BAB4C: vtkXMLParser::ParseBuffer(char const
, unsigned int) (vtkXMLParser.cxx:496)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24451 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Libs/MRML/Core/vtkMRMLScene.cxx Diff File