Improve peak-controller deletion, well, partially

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1683 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-09-22 15:11:55 +00:00
parent 668adaa2b2
commit f3d94b0e63
3 changed files with 18 additions and 1 deletions

View File

@@ -6,6 +6,10 @@
* plugins/lb302/lb302.cpp:
max wave-shape model's max match the new total of wave-shapes.
* include/peak_controller.h:
* src/core/peak_controller.cpp:
delete controller when effect is destroyed, but not the other way around
2008-09-21 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* src/core/plugin.cpp:

View File

@@ -59,7 +59,7 @@ public:
public slots:
virtual controllerDialog * createDialog( QWidget * _parent );
void handleDestroyedEffect( );
protected:
// The internal per-controller get-value function

View File

@@ -47,6 +47,8 @@ peakController::peakController( model * _parent,
controller( PeakController, _parent, tr( "Peak Controller" ) ),
m_peakEffect( _peak_effect )
{
connect( m_peakEffect, SIGNAL( destroyed( ) ),
this, SLOT( handleDestroyedEffect( ) ) );
}
@@ -70,6 +72,17 @@ float peakController::value( int _offset )
void peakController::handleDestroyedEffect( )
{
// possible race condition...
printf("disconnecting effect\n");
disconnect( m_peakEffect );
m_peakEffect = NULL;
//deleteLater();
delete this;
}
void peakController::saveSettings( QDomDocument & _doc, QDomElement & _this )
{