summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-11-09 16:19:33 -0800
committerMonroe Linden <monroe@lindenlab.com>2009-11-09 16:19:33 -0800
commitcaadf0be39b844e6bf91c5a302a837d107a1e415 (patch)
tree9a8555a9086ece77f83e85ed8a46e6b6ea4fbb0d /indra
parentb6de723de05ea0e2b748a697ed995efe7b466ffd (diff)
Fix for DEV-42029 (changing media on multiple faces can make a zombie SLPlugin).
Made LLViewerMedia::updateMediaImpl() unload the impl's media plugin when the current URL goes empty. Made LLVOVolume::syncMediaData() call removeMediaImpl() if the media data gets deleted.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewermedia.cpp14
-rw-r--r--indra/newview/llvovolume.cpp4
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 40bf9fb1fe..91f4ff9b84 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -261,9 +261,19 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
media_impl->mMediaSource->setSize(media_entry->getWidthPixels(), media_entry->getHeightPixels());
}
- if((was_loaded || (media_entry->getAutoPlay() && gSavedSettings.getBOOL("AutoPlayMedia"))) && !update_from_self)
+ if(media_entry->getCurrentURL().empty())
{
- if(!media_entry->getCurrentURL().empty())
+ // The current media URL is now empty. Unload the media source.
+ if(was_loaded)
+ media_impl->destroyMediaSource();
+ }
+ else
+ {
+ // The current media URL is not empty.
+ // If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent,
+ // do a navigate.
+
+ if((was_loaded || (media_entry->getAutoPlay() && gSavedSettings.getBOOL("AutoPlayMedia"))) && !update_from_self)
{
needs_navigate = (media_entry->getCurrentURL() != previous_url);
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index a32abf3ab9..c987dd1764 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1733,6 +1733,10 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
addMediaImpl(media_impl, texture_index) ;
}
+ else
+ {
+ removeMediaImpl(texture_index);
+ }
//llinfos << "AFTER: texture_index = " << texture_index
// << " hasMedia = " << te->hasMedia() << " : "