diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
| commit | 633dc75e857d649ffab7c4398e92536bccc9e1de (patch) | |
| tree | f9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/AudioCommon/OpenALStream.cpp | |
| parent | f4012638672472afdbd9956229f273a18a77fd77 (diff) | |
| parent | d802d392811be44d34ae9cd23f616db93e54c50f (diff) | |
Merge pull request #142 from Tilka/clang-modernize
Run clang-modernize and manually fix the result
Diffstat (limited to 'Source/Core/AudioCommon/OpenALStream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/OpenALStream.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/AudioCommon/OpenALStream.cpp b/Source/Core/AudioCommon/OpenALStream.cpp index b12ee66922..38e57beca2 100644 --- a/Source/Core/AudioCommon/OpenALStream.cpp +++ b/Source/Core/AudioCommon/OpenALStream.cpp @@ -17,17 +17,17 @@ bool OpenALStream::Start() { bool bReturn = false; - ALDeviceList *pDeviceList = new ALDeviceList(); - if ((pDeviceList) && (pDeviceList->GetNumDevices())) + ALDeviceList pDeviceList; + if (pDeviceList.GetNumDevices()) { - char *defDevName = pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice()); + char *defDevName = pDeviceList.GetDeviceName(pDeviceList.GetDefaultDevice()); WARN_LOG(AUDIO, "Found OpenAL device %s", defDevName); ALCdevice *pDevice = alcOpenDevice(defDevName); if (pDevice) { - ALCcontext *pContext = alcCreateContext(pDevice, NULL); + ALCcontext *pContext = alcCreateContext(pDevice, nullptr); if (pContext) { // Used to determine an appropriate period size (2x period = total buffer size) @@ -49,7 +49,6 @@ bool OpenALStream::Start() { PanicAlertT("OpenAL: can't open device %s", defDevName); } - delete pDeviceList; } else { @@ -84,7 +83,7 @@ void OpenALStream::Stop() ALCcontext *pContext = alcGetCurrentContext(); ALCdevice *pDevice = alcGetContextsDevice(pContext); - alcMakeContextCurrent(NULL); + alcMakeContextCurrent(nullptr); alcDestroyContext(pContext); alcCloseDevice(pDevice); } |
