ZynAddSubFX: check whether QDomDocument::setContent() succeeded
When saving settings in ZynAddSubFxInstrument::saveSettings() check whether the call to QDomDocument::setContent() succeeded. Otherwise LMMS crashes when calling QDomDocument::importNode() later due to a bug in QtXml. Fixes crash in the unlikely situation that transmission of XML data from the ZynAddSubFX plugin to LMMS somehow failed.
This commit is contained in:
@@ -158,9 +158,11 @@ void ZynAddSubFxInstrument::saveSettings( QDomDocument & _doc,
|
||||
m_pluginMutex.unlock();
|
||||
QByteArray a = tf.readAll();
|
||||
QDomDocument doc( "mydoc" );
|
||||
doc.setContent( a );
|
||||
QDomNode n = _doc.importNode( doc.documentElement(), true );
|
||||
_this.appendChild( n );
|
||||
if( doc.setContent( a ) )
|
||||
{
|
||||
QDomNode n = _doc.importNode( doc.documentElement(), true );
|
||||
_this.appendChild( n );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user