Skip to content
Snippets Groups Projects
Commit f21c1bdb authored by Anmol Ahuja's avatar Anmol Ahuja
Browse files

Destroy ScriptableServiceQueryMaker if parent collection destroyed.

Set servicePtr to null on destruction, check for null in related methods.

BUG: 321329
FIXED-IN: 2.8
parent 85939dd0
No related branches found
No related tags found
No related merge requests found
......@@ -310,6 +310,7 @@ ScriptManager::slotStopScript( const QString &name )
DEBUG_BLOCK
ScriptItem *item = m_scripts.value( name );
item->servicePtr = 0;
if( !item->engine ) {
warning() << "Script has no script engine attached:" << name;
return;
......@@ -339,17 +340,20 @@ void
ScriptManager::ServiceScriptPopulate( const QString &name, int level, int parent_id,
const QString &path, const QString &filter )
{
m_scripts.value( name )->servicePtr->slotPopulate( name, level, parent_id, path, filter );
if( m_scripts.value( name )->servicePtr )
m_scripts.value( name )->servicePtr->slotPopulate( name, level, parent_id, path, filter );
}
void ScriptManager::ServiceScriptCustomize( const QString &name )
{
m_scripts.value( name )->servicePtr->slotCustomize( name );
if( m_scripts.value( name )->servicePtr )
m_scripts.value( name )->servicePtr->slotCustomize( name );
}
void ScriptManager::ServiceScriptRequestInfo( const QString &name, int level, const QString &callbackString )
{
m_scripts.value( name )->servicePtr->slotRequestInfo( name, level, callbackString );
if( m_scripts.value( name )->servicePtr )
m_scripts.value( name )->servicePtr->slotRequestInfo( name, level, callbackString );
}
void
......
......@@ -47,7 +47,7 @@ ScriptableService::ScriptableService( const QString & name )
ScriptableService::~ ScriptableService()
{
delete m_collection;
m_collection->deleteLater();
}
void ScriptableService::init( int levels, const QString & rootHtml, bool showSearchBar )
......
......@@ -46,6 +46,7 @@ ScriptableServiceQueryMaker::ScriptableServiceQueryMaker( ScriptableServiceColle
, d( new Private )
{
setParent( collection );
m_collection = collection;
m_name = name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment