(trunk qt) fix a couple of small memory leaks detected by valgrind

This commit is contained in:
Charles Kerr 2010-07-28 20:17:16 +00:00
parent c5838c01ff
commit 56f9f899a2
4 changed files with 16 additions and 7 deletions

View File

@ -90,14 +90,15 @@ MyApp :: MyApp( int& argc, char ** argv ):
setApplicationName( MY_NAME );
// install the qt translator
QTranslator * t = new QTranslator( );
t->load( "qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
installTranslator( t );
QTranslator qtTranslator;
qtTranslator.load( "qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
installTranslator( &qtTranslator );
// install the transmission translator
t = new QTranslator( );
t->load( QString(MY_NAME) + "_" + QLocale::system().name() );
installTranslator( t );
QTranslator appTranslator;
appTranslator.load( QString(MY_NAME) + "_" + QLocale::system().name() );
installTranslator( &appTranslator );
Formatter::initUnits( );
// set the default icon

View File

@ -185,6 +185,9 @@ Details :: Details( Session& session, Prefs& prefs, TorrentModel& model, QWidget
Details :: ~Details( )
{
myTrackerDelegate->deleteLater();
myTrackerFilter->deleteLater();
myTrackerModel->deleteLater();
}
void

View File

@ -654,6 +654,11 @@ FileTreeView :: FileTreeView( QWidget * parent ):
this, SIGNAL(wantedChanged(const QSet<int>&, bool)));
}
FileTreeView :: ~FileTreeView( )
{
myProxy->deleteLater();
}
void
FileTreeView :: onClicked( const QModelIndex& proxyIndex )
{

View File

@ -141,7 +141,7 @@ class FileTreeView: public QTreeView
public:
FileTreeView( QWidget * parent=0 );
virtual ~FileTreeView( ) { }
virtual ~FileTreeView( );
void clear( );
void update( const FileList& files );
void update( const FileList& files, bool torrentChanged );