From 16b9399bd123c83ddc473b2fdc8032081203a18d Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 16 Dec 2014 23:19:36 +0300 Subject: [PATCH] Implement empty constructor for AudioDevice::LockHandle Useful if lock must be initialized after it was created --- SDL2pp/Audio.hh | 1 + SDL2pp/AudioLock.cc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/SDL2pp/Audio.hh b/SDL2pp/Audio.hh index ffbd554..baee880 100644 --- a/SDL2pp/Audio.hh +++ b/SDL2pp/Audio.hh @@ -60,6 +60,7 @@ public: LockHandle(AudioDevice* device); public: + LockHandle(); ~LockHandle(); LockHandle(LockHandle&& other) noexcept; diff --git a/SDL2pp/AudioLock.cc b/SDL2pp/AudioLock.cc index d426856..4193a98 100644 --- a/SDL2pp/AudioLock.cc +++ b/SDL2pp/AudioLock.cc @@ -23,6 +23,9 @@ namespace SDL2pp { +AudioDevice::LockHandle::LockHandle() : device_(nullptr) { +} + AudioDevice::LockHandle::LockHandle(AudioDevice* device) : device_(device) { SDL_LockAudioDevice(device_->device_id_); }