BUG: Fix memory leaks in qSlicerAppMainWindow
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== 5,172 (40 direct, 5,132 indirect) bytes in 1 blocks are definitely lost in loss record 2,404 of 2,448
==29339== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339== by 0x4E57C53: qSlicerAppMainWindowPrivate::setupUi(QMainWindow) (qSlicerAppMainWindow.cxx:334)
==29339== by 0x4E56C59: qSlicerAppMainWindowPrivate::init() (qSlicerAppMainWindow.cxx:122)
==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@24444 3bd1e089-480b-0410-8dfb-8563597acbee |