diff options
Diffstat (limited to 'servers/audio')
-rw-r--r-- | servers/audio/audio_driver_dummy.cpp | 12 | ||||
-rw-r--r-- | servers/audio/audio_driver_dummy.h | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index 5389c64099..69b098edfc 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -49,7 +49,6 @@ Error AudioDriverDummy::init() { samples_in = memnew_arr(int32_t, buffer_frames * channels); - mutex = Mutex::create(); thread = Thread::create(AudioDriverDummy::thread_func, this); return OK; @@ -95,16 +94,16 @@ AudioDriver::SpeakerMode AudioDriverDummy::get_speaker_mode() const { void AudioDriverDummy::lock() { - if (!thread || !mutex) + if (!thread) return; - mutex->lock(); + mutex.lock(); }; void AudioDriverDummy::unlock() { - if (!thread || !mutex) + if (!thread) return; - mutex->unlock(); + mutex.unlock(); }; void AudioDriverDummy::finish() { @@ -120,14 +119,11 @@ void AudioDriverDummy::finish() { }; memdelete(thread); - if (mutex) - memdelete(mutex); thread = NULL; }; AudioDriverDummy::AudioDriverDummy() { - mutex = NULL; thread = NULL; }; diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h index ba99e5a239..a2cd9b2dc6 100644 --- a/servers/audio/audio_driver_dummy.h +++ b/servers/audio/audio_driver_dummy.h @@ -39,7 +39,7 @@ class AudioDriverDummy : public AudioDriver { Thread *thread; - Mutex *mutex; + Mutex mutex; int32_t *samples_in; |