aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreviewanim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpreviewanim.cpp')
-rw-r--r--linden/indra/newview/llpreviewanim.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/linden/indra/newview/llpreviewanim.cpp b/linden/indra/newview/llpreviewanim.cpp
index bd619b4..ae98fb0 100644
--- a/linden/indra/newview/llpreviewanim.cpp
+++ b/linden/indra/newview/llpreviewanim.cpp
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2004-2007, Linden Research, Inc. 5 * Copyright (c) 2004-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -92,11 +93,14 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const
92// static 93// static
93void LLPreviewAnim::endAnimCallback( void *userdata ) 94void LLPreviewAnim::endAnimCallback( void *userdata )
94{ 95{
95 LLPreviewAnim* self = (LLPreviewAnim*) userdata; 96 LLViewHandle* handlep = ((LLViewHandle*)userdata);
96 97 LLFloater* self = getFloaterByHandle(*handlep);
97 self->childSetValue("Anim play btn", FALSE); 98 delete handlep; // done with the handle
98 self->childSetValue("Anim audition btn", FALSE); 99 if (self)
99 100 {
101 self->childSetValue("Anim play btn", FALSE);
102 self->childSetValue("Anim audition btn", FALSE);
103 }
100} 104}
101 105
102// static 106// static
@@ -124,7 +128,9 @@ void LLPreviewAnim::playAnim( void *userdata )
124 LLMotion* motion = avatar->findMotion(itemID); 128 LLMotion* motion = avatar->findMotion(itemID);
125 129
126 if (motion) 130 if (motion)
127 motion->setDeactivateCallback(&endAnimCallback, (void *)self); 131 {
132 motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle())));
133 }
128 } 134 }
129 else 135 else
130 { 136 {
@@ -159,7 +165,9 @@ void LLPreviewAnim::auditionAnim( void *userdata )
159 LLMotion* motion = avatar->findMotion(itemID); 165 LLMotion* motion = avatar->findMotion(itemID);
160 166
161 if (motion) 167 if (motion)
162 motion->setDeactivateCallback(&endAnimCallback, (void *)self); 168 {
169 motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLViewHandle(self->getHandle())));
170 }
163 } 171 }
164 else 172 else
165 { 173 {
@@ -209,8 +217,9 @@ void LLPreviewAnim::onClose(bool app_quitting)
209 LLMotion* motion = avatar->findMotion(item->getAssetUUID()); 217 LLMotion* motion = avatar->findMotion(item->getAssetUUID());
210 218
211 if (motion) 219 if (motion)
220 {
212 motion->setDeactivateCallback(NULL, (void *)NULL); 221 motion->setDeactivateCallback(NULL, (void *)NULL);
213 222 }
214 } 223 }
215 destroy(); 224 destroy();
216} 225}