BUG: Fix memory leak in qMRMLCheckableNodeComboBox
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== 474 (32 direct, 442 indirect) bytes in 1 blocks are definitely lost in loss record 2,158 of 2,448
==29339== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29339== by 0x5E1AA09: qMRMLCheckableNodeComboBoxPrivate::init(QAbstractItemModel) (qMRMLCheckableNodeComboBox.cxx:63)
==29339== by 0x5E5E445: qMRMLNodeComboBox::qMRMLNodeComboBox(qMRMLNodeComboBoxPrivate, QWidget) (qMRMLNodeComboBox.cxx:399)
==29339== by 0x5E1AB88: qMRMLCheckableNodeComboBox::qMRMLCheckableNodeComboBox(QWidget) (qMRMLCheckableNodeComboBox.cxx:89)
==29339== by 0x5E2E712: qMRMLDisplayNodeViewComboBox::qMRMLDisplayNodeViewComboBox(QWidget) (qMRMLDisplayNodeViewComboBox.cxx:74)
==29339== by 0x1046D9FDC: Ui_qSlicerMarkupsModule::setupUi(qSlicerWidget) (ui_qSlicerMarkupsModule.h:472)
==29339== by 0x1046C4016: qSlicerMarkupsModuleWidgetPrivate::setupUi(qSlicerWidget) (qSlicerMarkupsModuleWidget.cxx:135)
==29339== by 0x1046C6B55: qSlicerMarkupsModuleWidget::setup() (qSlicerMarkupsModuleWidget.cxx:464)
==29339== by 0x8E819EA: qSlicerAbstractModuleRepresentation::setModule(qSlicerAbstractCoreModule) (qSlicerAbstractModuleRepresentation.cxx:82)
==29339== by 0x8E714A2: qSlicerAbstractCoreModule::createNewWidgetRepresentation() (qSlicerAbstractCoreModule.cxx:258)
==29339== by 0x8E7133B: qSlicerAbstractCoreModule::widgetRepresentation() (qSlicerAbstractCoreModule.cxx:226)
==29339== by 0x1046C224A: qSlicerMarkupsModule::setup() (qSlicerMarkupsModule.cxx:153)
git-svn-id: http://svn.slicer.org/Slicer4/trunk@24443 3bd1e089-480b-0410-8dfb-8563597acbee |