History

Some more memory leaks and codes formatting

atlante45 committed 13 years ago

Commit b03482e1 parent 061199923 files · +145 −91Browse files

Showing the changes to interface/src/Menu.cpp (1 of 23 files). Show all

Unified · Split

interface/src/Menu.cpp+15−4
@@ -413,6 +413,13 @@ Menu::Menu() : · 412 unmodified lines
413 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DestructiveAddVoxel);413 addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DestructiveAddVoxel);
414}414}
415 415
416Menu::~Menu() {
417 qDebug("[DEBUG] Menu destructor.\n]");
418 bandwidthDetailsClosed();
419 voxelStatsDetailsClosed();
420 delete _voxelModeActionsGroup;
421}
422
416void Menu::loadSettings(QSettings* settings) {423void Menu::loadSettings(QSettings* settings) {
417 if (!settings) {424 if (!settings) {
418 settings = Application::getInstance()->getSettings();425 settings = Application::getInstance()->getSettings();
@@ -855,8 +862,10 @@ void Menu::bandwidthDetails() { · 436 unmodified lines
855}862}
856 863
857void Menu::bandwidthDetailsClosed() {864void Menu::bandwidthDetailsClosed() {
858 delete _bandwidthDialog;865 if (_bandwidthDialog) {
859 _bandwidthDialog = NULL;866 delete _bandwidthDialog;
867 _bandwidthDialog = NULL;
868 }
860}869}
861 870
862void Menu::voxelStatsDetails() {871void Menu::voxelStatsDetails() {
@@ -870,8 +879,10 @@ void Menu::voxelStatsDetails() { · 7 unmodified lines
870}879}
871 880
872void Menu::voxelStatsDetailsClosed() {881void Menu::voxelStatsDetailsClosed() {
873 delete _voxelStatsDialog;882 if (_voxelStatsDialog) {
874 _voxelStatsDialog = NULL;883 delete _voxelStatsDialog;
884 _voxelStatsDialog = NULL;
885 }
875}886}
876 887
877void Menu::cycleFrustumRenderMode() {888void Menu::cycleFrustumRenderMode() {