From b6bc3cb166a1a0086074d29f6db52fa8d0f1f1e4 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 13 Nov 2013 15:56:03 -0800 Subject: [PATCH] handle changes in server list properly --- interface/src/Application.cpp | 1 + interface/src/ui/VoxelStatsDialog.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 42c48bc397..71b63e8593 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -249,6 +249,7 @@ Application::~Application() { _audio.shutdown(); + VoxelNode::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown delete Menu::getInstance(); delete _oculusProgram; diff --git a/interface/src/ui/VoxelStatsDialog.cpp b/interface/src/ui/VoxelStatsDialog.cpp index c3f3226719..ab1371f53f 100644 --- a/interface/src/ui/VoxelStatsDialog.cpp +++ b/interface/src/ui/VoxelStatsDialog.cpp @@ -57,8 +57,12 @@ VoxelStatsDialog::VoxelStatsDialog(QWidget* parent, NodeToVoxelSceneStats* model } void VoxelStatsDialog::RemoveStatItem(int item) { - QLabel* label = _labels[item]; - delete label; + QLabel* myLabel = _labels[item]; + QWidget* automaticLabel = _form->labelForField(myLabel); + _form->removeWidget(myLabel); + _form->removeWidget(automaticLabel); + automaticLabel->deleteLater(); + myLabel->deleteLater(); _labels[item] = NULL; } @@ -194,7 +198,6 @@ void VoxelStatsDialog::paintEvent(QPaintEvent* event) { "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; label->setText(statsValue.str().c_str()); - showAllVoxelServers(); this->QDialog::paintEvent(event);