From 1bf92af2d4dc1f228dfc329503d0d07c725054a8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 26 Feb 2009 16:35:10 +0100 Subject: [PATCH] PeakController: always check for m_peakEffect != NULL before using it as sometimes it keeps NULL due to bugs in PeakController and PeakControllerEffect deletion (closes #2616486) --- src/core/peak_controller.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/peak_controller.cpp b/src/core/peak_controller.cpp index 161d17c95..11eaa6e97 100644 --- a/src/core/peak_controller.cpp +++ b/src/core/peak_controller.cpp @@ -48,8 +48,11 @@ peakController::peakController( model * _parent, controller( PeakController, _parent, tr( "Peak Controller" ) ), m_peakEffect( _peak_effect ) { - connect( m_peakEffect, SIGNAL( destroyed( ) ), + if( m_peakEffect ) + { + connect( m_peakEffect, SIGNAL( destroyed( ) ), this, SLOT( handleDestroyedEffect( ) ) ); + } } @@ -87,9 +90,12 @@ void peakController::handleDestroyedEffect( ) void peakController::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - controller::saveSettings( _doc, _this ); + if( m_peakEffect ) + { + controller::saveSettings( _doc, _this ); - _this.setAttribute( "effectId", m_peakEffect->m_effectId ); + _this.setAttribute( "effectId", m_peakEffect->m_effectId ); + } }