Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Properly remove ScriptCollection ViewPages to prevent crash.

  • Loading branch information...
commit c4fbcdfcbc5b251add7f292cca37615c875703c0 1 parent b18fac9
@teo teo authored
View
3  src/sourcetree/SourcesModel.cpp
@@ -537,7 +537,6 @@ SourcesModel::onScriptCollectionRemoved( const collection_ptr& collection )
m_cloudGroup->removeChild( item );
endRemoveRows();
- dynamic_cast< QObject* >( m_scriptCollectionPages.value( collection ) )->deleteLater();
m_scriptCollectionPages.remove( collection );
m_scriptCollections.remove( collection );
item->deleteLater();
@@ -547,7 +546,7 @@ SourcesModel::onScriptCollectionRemoved( const collection_ptr& collection )
ViewPage*
SourcesModel::scriptCollectionClicked( const Tomahawk::collection_ptr& collection )
{
- m_scriptCollectionPages[ collection ] = ViewManager::instance()->show( collection );
+ m_scriptCollectionPages.insert( collection, ViewManager::instance()->show( collection ) );
return m_scriptCollectionPages[ collection ];
}
View
2  src/sourcetree/items/ScriptCollectionItem.cpp
@@ -33,6 +33,8 @@ ScriptCollectionItem::ScriptCollectionItem( SourcesModel* model,
ScriptCollectionItem::~ScriptCollectionItem()
{
model()->removeSourceItemLink( this );
+ ViewManager::instance()->destroyPage( m_page );
+ dynamic_cast< QObject* >( m_page )->deleteLater();
}
Please sign in to comment.
Something went wrong with that request. Please try again.