aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-04 20:17:54 -0700
committerChris Robinson <[email protected]>2019-05-04 20:34:33 -0700
commit95d19be36bf1d8b08fdb9cd09d94bc37658deea6 (patch)
treec26bb014d48f7408ee20748a73ff4b96f5649a4d
parentb9592bddbc014759941b94b76596c1dbf2245ad3 (diff)
Catch exceptions from backend reset
-rw-r--r--Alc/alc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 9b4c2978..6bd755bf 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -1888,8 +1888,14 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
(device->Flags&DEVICE_FREQUENCY_REQUEST)?"*":"", device->Frequency,
device->UpdateSize, device->BufferSize);
- if(device->Backend->reset() == ALC_FALSE)
+ try {
+ if(device->Backend->reset() == ALC_FALSE)
+ return ALC_INVALID_DEVICE;
+ }
+ catch(std::exception &e) {
+ ERR("Device reset failed: %s\n", e.what());
return ALC_INVALID_DEVICE;
+ }
if(device->FmtChans != oldChans && (device->Flags&DEVICE_CHANNELS_REQUEST))
{