Commit 9ca5a010 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Solved memleak when unloading media from library

parent a55f4315
......@@ -128,7 +128,7 @@ void MainWindow::setupLibrary()
connect( library,
SIGNAL( mediaRemoved( const QUuid& ) ),
libraryWidget,
SLOT( mediaRemoved( const QUuid& ) ) );
SLOT( mediaRemoved( const QUuid& ) ), Qt::DirectConnection );
connect( libraryWidget->getVideoListWidget(), SIGNAL( selectedClipChanged( Clip* ) ),
m_clipPreview->getGenericRenderer(), SLOT( setClip( Clip* ) ) );
......
......@@ -49,11 +49,13 @@ void Library::removingMediaAsked( const QUuid& uuid )
QHash<QUuid, Media*>::iterator it = m_medias.find( uuid );
if ( it == m_medias.end() )
return ;
Media* media = it.value();
emit mediaRemoved( uuid );
//TODO: this is obviously a memleak, but at the moment, the library depends on the clip to work,
//and won't be abble to remove the ListViewMediaItem without it.
//delete *it;
m_medias.erase( it );
delete media;
}
void Library::metaDataComputed( Media* media )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment