From 35fe7aaedd5657898e152676f7744c14f7afa937 Mon Sep 17 00:00:00 2001
From: Stinson Linden <stinson@lindenlab.com>
Date: Mon, 12 May 2014 21:34:30 +0100
Subject: [PATCH] MAINT-4009: Patching a leak of keyframed motions that had
 been deprecated but were never properly destroyed.

---
 indra/llcharacter/llmotioncontroller.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 50ccfd75fbc..e02b139608f 100755
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -172,6 +172,13 @@ void LLMotionController::deleteAllMotions()
 
 	for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
 	mAllMotions.clear();
+
+	// stinson 05/12/20014 : Ownership of the LLMotion pointers is transferred from
+	// mAllMotions to mDeprecatedMotions in method
+	// LLMotionController::deprecateMotionInstance().  Thus, we should also clean
+	// up the mDeprecatedMotions list as well.
+	for_each(mDeprecatedMotions.begin(), mDeprecatedMotions.end(), DeletePointer());
+	mDeprecatedMotions.clear();
 }
 
 //-----------------------------------------------------------------------------
-- 
GitLab