Skip to content

Commit

Permalink
WITCHER: Use ScopedPtr in Module
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 26, 2016
1 parent b44a030 commit 2926a1f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/engines/witcher/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* The context needed to run a The Witcher module.
*/

#include "src/common/scopedptr.h"
#include "src/common/util.h"
#include "src/common/maths.h"
#include "src/common/error.h"
Expand Down Expand Up @@ -215,7 +216,7 @@ bool Module::getObjectLocation(const Common::UString &object, Common::UString &a
if (object.empty())
return false;

Aurora::NWScript::ObjectSearch *search = findObjectsByTag(object);
Common::ScopedPtr<Aurora::NWScript::ObjectSearch> search(findObjectsByTag(object));

Witcher::Object *witcherObject = 0;
while (!witcherObject && search->get()) {
Expand All @@ -224,8 +225,6 @@ bool Module::getObjectLocation(const Common::UString &object, Common::UString &a
witcherObject = 0;
}

delete search;

if (!witcherObject)
return false;

Expand Down

0 comments on commit 2926a1f

Please sign in to comment.