Audio: Fix stream not being unlocked on exception

This commit is contained in:
Jonas Kulla 2013-12-28 23:10:43 +01:00
parent 99866fb84c
commit 01529c5741
1 changed files with 13 additions and 1 deletions

View File

@ -1273,7 +1273,19 @@ struct AudioStream
stream.close(); stream.close();
case ALStream::Closed : case ALStream::Closed :
if (diffFile) if (diffFile)
stream.open(filename); {
try
{
/* This will throw on errors while
* opening the data source */
stream.open(filename);
}
catch (const Exception &e)
{
unlockStream();
throw e;
}
}
break; break;
} }