fixed more leaks

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1221 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-30 12:38:35 +00:00
parent fcfb02fbaa
commit 7d8a15f2db
7 changed files with 40 additions and 16 deletions

View File

@@ -27,6 +27,7 @@
#define _MV_BASE_H
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include "export.h"
@@ -97,19 +98,24 @@ public:
inline model * getModel( void )
{
return( m_model );
return( m_model.data() );
}
inline const model * getModel( void ) const
{
return( m_model.data() );
}
template<class T>
T * castModel( void )
{
return( dynamic_cast<T *>( m_model ) );
return( dynamic_cast<T *>( getModel() ) );
}
template<class T>
const T * castModel( void ) const
{
return( dynamic_cast<T *>( m_model ) );
return( dynamic_cast<const T *>( getModel() ) );
}
@@ -129,7 +135,7 @@ protected:
private:
QWidget * m_widget;
model * m_model;
QPointer<model> m_model;
} ;