Skip to content

Commit

Permalink
DRAGONAGE2: Use ScopedPtr in Area
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent 8ac69c9 commit b21afa9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/engines/dragonage2/area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ Area::Area(Campaign &campaign, const Common::UString &resRef,
}

Area::~Area() {
try {
clean();
} catch (...) {
}
clean();
}

const Common::UString &Area::getResRef() const {
Expand All @@ -98,17 +95,20 @@ const Aurora::LocString &Area::getName() const {
}

void Area::clean() {
hide();
try {
hide();

for (Objects::iterator o = _objects.begin(); o != _objects.end(); ++o) {
_campaign->removeObject(**o);
delete *o;
}
for (Objects::iterator o = _objects.begin(); o != _objects.end(); ++o) {
_campaign->removeObject(**o);
delete *o;
}

for (Rooms::iterator r = _rooms.begin(); r != _rooms.end(); ++r)
delete *r;
for (Rooms::iterator r = _rooms.begin(); r != _rooms.end(); ++r)
delete *r;

deindexResources(_resources);
deindexResources(_resources);
} catch (...) {
}
}

void Area::load(const Common::UString &resRef, const Common::UString &env, const Common::UString &rim) {
Expand Down

0 comments on commit b21afa9

Please sign in to comment.