1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

OP-242 : Fix notify crash on Linux. Additional check on phono media object in the playback callback to avoid race conditions.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2344 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2011-01-07 14:59:54 +00:00 committed by edouard
parent 489fde5357
commit c4b6b16181

View File

@ -148,8 +148,10 @@ void SoundNotifyPlugin::connectNotifications()
if (obj != NULL)
disconnect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(appendNotification(UAVObject*)));
}
if(phonon.mo != NULL)
delete phonon.mo;
if(phonon.mo != NULL) {
delete phonon.mo;
phonon.mo = NULL;
}
if(!enableSound) return;
@ -287,6 +289,10 @@ void SoundNotifyPlugin::checkNotificationRule(NotifyPluginConfiguration* notific
bool SoundNotifyPlugin::playNotification(NotifyPluginConfiguration* notification)
{
// Check: race condition, if phonon.mo got deleted don't go further
if (phonon.mo == NULL)
return false;
#ifdef DEBUG_NOTIFIES
qDebug() << "Phonon State: " << phonon.mo->state();
#endif