diff options
author | Chris Robinson <[email protected]> | 2019-05-04 20:17:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-04 20:34:33 -0700 |
commit | 95d19be36bf1d8b08fdb9cd09d94bc37658deea6 (patch) | |
tree | c26bb014d48f7408ee20748a73ff4b96f5649a4d | |
parent | b9592bddbc014759941b94b76596c1dbf2245ad3 (diff) |
Catch exceptions from backend reset
-rw-r--r-- | Alc/alc.cpp | 8 |
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)) { |