BUG: Fix memory leak in vtkSlicerApplicationLogic
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== 336 bytes in 1 blocks are possibly lost in loss record 2,088 of 2,448
==29339== at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339== by 0x4012E54: _dl_allocate_tls (dl-tls.c:296)
==29339== by 0x1E25BDA0: pthread_create@@GLIBC_2.2.5 (allocatestack.c:589)
==29339== by 0x18D6A33E: itk::MultiThreader::SpawnThread(void ()(void), void) (itkMultiThreaderPThreads.cxx:186)
==29339== by 0x9259575: vtkSlicerApplicationLogic::CreateProcessingThread() (vtkSlicerApplicationLogic.cxx:354)
==29339== by 0x8E82DC8: qSlicerCoreApplicationPrivate::init() (qSlicerCoreApplication.cxx:255)
==29339== by 0x59272A7: qSlicerApplicationPrivate::init() (qSlicerApplication.cxx:180)
==29339== by 0x5927FDF: qSlicerApplication::qSlicerApplication(int&, char) (qSlicerApplication.cxx:319)
==29339== by 0x406039: (anonymous namespace)::SlicerAppMain(int, char) (Main.cxx:125)
==29339== by 0x406D30: main (Main.cxx:254)
git-svn-id: http://svn.slicer.org/Slicer4/trunk@24440 3bd1e089-480b-0410-8dfb-8563597acbee |