From bafcba7194c36eaf4fa1cb09b000170f8a138055 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Nov 2018 18:45:45 -0800 Subject: Use a std::string for the device name --- Alc/backends/winmm.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Alc/backends/winmm.cpp') diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp index 8b97daab..9da3e4c3 100644 --- a/Alc/backends/winmm.cpp +++ b/Alc/backends/winmm.cpp @@ -285,8 +285,7 @@ retry_open: return ALC_INVALID_VALUE; } - al_free(device->DeviceName); - device->DeviceName = alstrdup(PlaybackDevices[DeviceID].c_str()); + device->DeviceName = PlaybackDevices[DeviceID]; return ALC_NO_ERROR; } @@ -606,8 +605,7 @@ ALCenum ALCwinmmCapture_open(ALCwinmmCapture *self, const ALCchar *deviceName) self->WaveBuffer[i].dwBufferLength = self->WaveBuffer[i-1].dwBufferLength; } - al_free(device->DeviceName); - device->DeviceName = alstrdup(CaptureDevices[DeviceID].c_str()); + device->DeviceName = CaptureDevices[DeviceID]; return ALC_NO_ERROR; } -- cgit v1.2.3