BUG: Fix memory leak in vtkMRMLLayoutNode
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
exected doing the following:
(1) Start a terminal with the appropriate environment: ./Slicer --gnome-terminal
(2) Start Slicer using valgrind: valgrind --log-file=2015-07-16-Slicer-memcheck.txt --tool=memcheck --leak-check=yes ./bin/SlicerApp-real --disable-python --disable-cli-modules
(3) Exit Slicer and inspect valgrind log file
Valgrind error:
==29339== 1,082 bytes in 1 blocks are definitely lost in loss record 2,290 of 2,448
==29339== at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339== by 0xE6E4563: vtkMRMLLayoutNode::SetCurrentLayoutDescription(char const) (in /home/jcfr/Projects/Slicer-Debug/Slicer-build/bin/libMRMLCore.so)
==29339== by 0xE6E05B0: vtkMRMLLayoutNode::SetAndParseCurrentLayoutDescription(char const) (vtkMRMLLayoutNode.cxx:285)
==29339== by 0xE6E04D6: vtkMRMLLayoutNode::UpdateCurrentLayoutDescription() (vtkMRMLLayoutNode.cxx:273)
==29339== by 0xE6DFB4C: vtkMRMLLayoutNode::SetViewArrangement(int) (vtkMRMLLayoutNode.cxx:203)
==29339== by 0x5E4212D: qMRMLLayoutManager::setLayout(int) (qMRMLLayoutManager.cxx:903)
==29339== by 0x4E59081: qSlicerAppMainWindowPrivate::readSettings() (qSlicerAppMainWindow.cxx:490)
==29339== by 0x4E56CDE: qSlicerAppMainWindowPrivate::init() (qSlicerAppMainWindow.cxx:127)
==29339== by 0x4E5A98D: qSlicerAppMainWindow::qSlicerAppMainWindow(QWidget*) (qSlicerAppMainWindow.cxx:676)
==29339== by 0x406553: (anonymous namespace)::SlicerAppMain(int, char**) (Main.cxx:184)
==29339== by 0x406D30: main (Main.cxx:254)
git-svn-id: http://svn.slicer.org/Slicer4/trunk@24441 3bd1e089-480b-0410-8dfb-8563597acbee |