aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2011-03-27 12:54:11 +0200
committerShauren <shauren.trinity@gmail.com>2011-03-27 12:54:11 +0200
commit9fea7d9a85b4f0fb7653a3f2f53a8ad73b0063d4 (patch)
treee35818ab00d18a1f9981be1f48cb7dc35719fb94
parentd26b18be2ae1f7fea3c6aa0e9478d98a74ddcfa5 (diff)
Core/SAI: Fixed another memory leak
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp10
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 94c4a0a0955..3fda7ebbe26 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -51,7 +51,15 @@ SmartScript::SmartScript()
meOrigGUID = 0;
goOrigGUID = 0;
mResumeActionList = true;
- mLastInvoker = NULL;
+ mLastInvoker = 0;
+}
+
+SmartScript::~SmartScript()
+{
+ for (ObjectListMap::iterator itr = mTargetStorage->begin(); itr != mTargetStorage->end(); ++itr)
+ delete itr->second;
+
+ delete mTargetStorage;
}
void SmartScript::OnReset()
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 0daa81cdcf9..34e1faf9696 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -33,8 +33,8 @@
class SmartScript
{
public:
- ~SmartScript(){};
SmartScript();
+ ~SmartScript();
void OnInitialize(WorldObject* obj, AreaTriggerEntry const* at = NULL);
void GetScript();