mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
Merge pull request #4715 from jherico/audio_crash
Attempting to resolve possible crash case for scripts playing sounds
This commit is contained in:
commit
a121ac08b3
1 changed files with 5 additions and 1 deletions
|
@ -13,8 +13,12 @@
|
|||
#include "ScriptAudioInjector.h"
|
||||
|
||||
QScriptValue injectorToScriptValue(QScriptEngine* engine, ScriptAudioInjector* const& in) {
|
||||
// The AudioScriptingInterface::playSound method can return null, so we need to account for that.
|
||||
if (!in) {
|
||||
return QScriptValue(QScriptValue::NullValue);
|
||||
}
|
||||
|
||||
// when the script goes down we want to cleanup the injector
|
||||
|
||||
QObject::connect(engine, &QScriptEngine::destroyed, in, &ScriptAudioInjector::stopInjectorImmediately,
|
||||
Qt::DirectConnection);
|
||||
|
||||
|
|
Loading…
Reference in a new issue