Commit ead96254 authored by Matthias Möller's avatar Matthias Möller

fix memory leak

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18418 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a9b307e7
......@@ -834,6 +834,11 @@ void CoreWidget::slotUpdateViewerDrawMenu() {
connect(viewerDrawMenu_,SIGNAL(aboutToShow () ) , this, SLOT(slotUpdateGlobalDrawMenu() ) );
}
if (viewerDrawMenuWidget_) {
delete viewerDrawMenuWidget_;
}
viewerDrawMenuWidget_ = new QWidget(viewerDrawMenu_);
// Collect available draw modes
// Single pass action, draw modes independent from multipass rendering
ACG::SceneGraph::CollectDrawModesAction actionAvailable;
......@@ -855,7 +860,7 @@ void CoreWidget::slotUpdateViewerDrawMenu() {
ACG::SceneGraph::DrawModes::DrawMode id = availDrawModeIds[i];
std::string descr = id.description();
QCheckBox *checkBox = new QCheckBox(QString(descr.c_str()), viewerDrawMenu_);
QCheckBox *checkBox = new QCheckBox(QString(descr.c_str()), viewerDrawMenuWidget_);
checkBox->setChecked(activeDrawModes.containsAtomicDrawMode(id));
QWidgetAction *checkableAction = new QWidgetAction(drawGroupViewer_);
checkableAction->setText(descr.c_str());
......
......@@ -175,6 +175,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
contextSelectionMenu_(0),
drawGroupViewer_(0),
viewerDrawMenu_(0),
viewerDrawMenuWidget_(0),
coordSysMenu_(0),
snapshotName_(""),
snapshotCounter_(0),
......
......@@ -984,6 +984,9 @@ public:
/// Draw Menu for per Viewer Draw Modes
QMenu* viewerDrawMenu_;
/// owns all the checkboxes of viewerDrawMenu_
QWidget* viewerDrawMenuWidget_;
/// Menu which holds the context menu entries for
/// the coordsys node if invisible
QMenu* coordSysMenu_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment