From 302b3cf3518f5caa91868462ec1e8d35195122c6 Mon Sep 17 00:00:00 2001 From: Carl Pillot Date: Thu, 11 Jul 2013 17:58:51 -0700 Subject: [PATCH 1/2] Delete leaking controls --- src/dlgprefcontrols.cpp | 2 ++ src/engine/positionscratchcontroller.cpp | 1 + src/engine/vinylcontrolcontrol.cpp | 5 ++++- src/recording/recordingmanager.cpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dlgprefcontrols.cpp b/src/dlgprefcontrols.cpp index abbcd57a5fc..56df0b6e792 100644 --- a/src/dlgprefcontrols.cpp +++ b/src/dlgprefcontrols.cpp @@ -299,6 +299,8 @@ DlgPrefControls::~DlgPrefControls() foreach (ControlObjectThreadMain* pControl, m_rateRangeControls) { delete pControl; } + + delete m_pControlPositionDisplay; } void DlgPrefControls::slotUpdateSchemes() diff --git a/src/engine/positionscratchcontroller.cpp b/src/engine/positionscratchcontroller.cpp index ba1a57ba0fd..faadea98aea 100644 --- a/src/engine/positionscratchcontroller.cpp +++ b/src/engine/positionscratchcontroller.cpp @@ -87,6 +87,7 @@ PositionScratchController::PositionScratchController(const char* pGroup) PositionScratchController::~PositionScratchController() { delete m_pScratchEnable; + delete m_pScratchPosition; delete m_pVelocityController; delete m_pRateIIFilter; } diff --git a/src/engine/vinylcontrolcontrol.cpp b/src/engine/vinylcontrolcontrol.cpp index 82c68f937a4..99d416e491a 100644 --- a/src/engine/vinylcontrolcontrol.cpp +++ b/src/engine/vinylcontrolcontrol.cpp @@ -45,12 +45,15 @@ VinylControlControl::VinylControlControl(const char* pGroup, ConfigObject* pConfig, EngineMas RecordingManager::~RecordingManager() { qDebug() << "Delete RecordingManager"; + delete m_pToggleRecording; delete m_recReadyCO; delete m_recReady; } From 42b595290995a968c9f28640247349f54cc5a12e Mon Sep 17 00:00:00 2001 From: Carl Pillot Date: Thu, 11 Jul 2013 19:40:34 -0700 Subject: [PATCH 2/2] Changed control delete order for modified files to reverse of construction order (following google style guidelines). --- src/dlgprefcontrols.cpp | 4 ++-- src/engine/positionscratchcontroller.cpp | 6 +++--- src/engine/vinylcontrolcontrol.cpp | 16 ++++++++-------- src/recording/recordingmanager.cpp | 5 +++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/dlgprefcontrols.cpp b/src/dlgprefcontrols.cpp index 56df0b6e792..f7508286091 100644 --- a/src/dlgprefcontrols.cpp +++ b/src/dlgprefcontrols.cpp @@ -287,6 +287,8 @@ DlgPrefControls::DlgPrefControls(QWidget * parent, MixxxApp * mixxx, DlgPrefControls::~DlgPrefControls() { + delete m_pControlPositionDisplay; + foreach (ControlObjectThreadMain* pControl, m_rateControls) { delete pControl; } @@ -299,8 +301,6 @@ DlgPrefControls::~DlgPrefControls() foreach (ControlObjectThreadMain* pControl, m_rateRangeControls) { delete pControl; } - - delete m_pControlPositionDisplay; } void DlgPrefControls::slotUpdateSchemes() diff --git a/src/engine/positionscratchcontroller.cpp b/src/engine/positionscratchcontroller.cpp index faadea98aea..77ced4bb612 100644 --- a/src/engine/positionscratchcontroller.cpp +++ b/src/engine/positionscratchcontroller.cpp @@ -86,10 +86,10 @@ PositionScratchController::PositionScratchController(const char* pGroup) } PositionScratchController::~PositionScratchController() { - delete m_pScratchEnable; - delete m_pScratchPosition; - delete m_pVelocityController; delete m_pRateIIFilter; + delete m_pVelocityController; + delete m_pScratchPosition; + delete m_pScratchEnable; } //volatile double _p = 0.3; diff --git a/src/engine/vinylcontrolcontrol.cpp b/src/engine/vinylcontrolcontrol.cpp index 99d416e491a..c89d20651f0 100644 --- a/src/engine/vinylcontrolcontrol.cpp +++ b/src/engine/vinylcontrolcontrol.cpp @@ -45,15 +45,15 @@ VinylControlControl::VinylControlControl(const char* pGroup, ConfigObject* pConfig, EngineMas RecordingManager::~RecordingManager() { qDebug() << "Delete RecordingManager"; - delete m_pToggleRecording; - delete m_recReadyCO; + delete m_recReady; + delete m_recReadyCO; + delete m_pToggleRecording; } QString RecordingManager::formatDateTimeForFilename(QDateTime dateTime) const {