Skip to content

Commit

Permalink
AURORA: Use ScopedPtr in SSFFile
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent d0ae588 commit 58a6176
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/aurora/ssffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* (<https://github.com/xoreos/xoreos-docs/tree/master/specs/bioware>)
*/

#include "src/common/scopedptr.h"
#include "src/common/readstream.h"
#include "src/common/writestream.h"
#include "src/common/writefile.h"
Expand Down Expand Up @@ -55,18 +56,11 @@ SSFFile::SSFFile(Common::SeekableReadStream &ssf) {
}

SSFFile::SSFFile(const Common::UString &ssf) {
Common::SeekableReadStream *res = ResMan.getResource(ssf, kFileTypeSSF);
Common::ScopedPtr<Common::SeekableReadStream> res(ResMan.getResource(ssf, kFileTypeSSF));
if (!res)
throw Common::Exception("No such SSF \"%s\"", ssf.c_str());

try {
load(*res);
} catch (...) {
delete res;
throw;
}

delete res;
load(*res);
}

SSFFile::~SSFFile() {
Expand Down

0 comments on commit 58a6176

Please sign in to comment.