From 312e7d21a4d4996460e84aca478691ac0a4828ea Mon Sep 17 00:00:00 2001 From: Monroe Linden <monroe@lindenlab.com> Date: Mon, 9 Nov 2009 17:11:13 -0800 Subject: [PATCH] Refinement to my previous commit: Created LLViewerMediaImpl::unload(), which unloads the media and clears internal state (such as the last-navigated URL) to keep it from getting reloaded. LLViewerMedia::updateMediaImpl() now calls unload() on the impl instead of just using destroyMediaSource(). --- indra/newview/llviewermedia.cpp | 14 ++++++++++++-- indra/newview/llviewermedia.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 91f4ff9b845..11c1fcb1ea5 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -264,8 +264,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s if(media_entry->getCurrentURL().empty()) { // The current media URL is now empty. Unload the media source. - if(was_loaded) - media_impl->destroyMediaSource(); + media_impl->unload(); } else { @@ -1270,6 +1269,17 @@ void LLViewerMediaImpl::navigateHome() navigateTo(mHomeURL, "", true, false); } +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::unload() +{ + // Unload the media impl and clear its state. + destroyMediaSource(); + resetPreviousMediaState(); + mMediaURL.clear(); + mMimeType.clear(); + mCurrentMediaURL.clear(); +} + ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 4cb08177353..7cbfb56ffcc 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -165,6 +165,7 @@ class LLViewerMediaImpl void navigateForward(); void navigateReload(); void navigateHome(); + void unload(); void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false); void navigateInternal(); void navigateStop(); -- GitLab