summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp8
-rw-r--r--indra/newview/llappviewer.h1
-rw-r--r--indra/newview/llviewermenu.cpp19
-rw-r--r--indra/newview/llviewerregion.cpp4
-rw-r--r--indra/newview/llviewerregion.h4
-rw-r--r--indra/newview/llvocache.cpp14
-rw-r--r--indra/newview/llvocache.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml10
8 files changed, 56 insertions, 6 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3e61787c13..6b50c62ea6 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4011,6 +4011,14 @@ void LLAppViewer::purgeCache()
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*.*");
}
+//purge cache immediately, do not wait until the next login.
+void LLAppViewer::purgeCacheImmediate()
+{
+ LL_INFOS("AppCache") << "Purging Object Cache and Texture Cache immediately..." << LL_ENDL;
+ LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
+ LLVOCache::getInstance()->removeCache(LL_PATH_CACHE, true);
+}
+
std::string LLAppViewer::getSecondLifeTitle() const
{
return LLTrans::getString("APP_NAME");
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 85a29925fb..627652dc30 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -170,6 +170,7 @@ public:
void addOnIdleCallback(const boost::function<void()>& cb); // add a callback to fire (once) when idle
void purgeCache(); // Clear the local cache.
+ void purgeCacheImmediate(); //clear local cache immediately.
// mute/unmute the system's master audio
virtual void setMasterSystemAudioMute(bool mute);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 25907dcb52..eebf4f0bea 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7566,6 +7566,23 @@ void handle_web_browser_test(const LLSD& param)
LLWeb::loadURLInternal(url);
}
+bool callback_clear_cache_immediately(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if ( option == 0 ) // YES
+ {
+ //clear cache
+ LLAppViewer::instance()->purgeCacheImmediate();
+ }
+
+ return false;
+}
+
+void handle_cache_clear_immediately()
+{
+ LLNotificationsUtil::add("ConfirmClearCache", LLSD(), LLSD(), callback_clear_cache_immediately);
+}
+
void handle_web_content_test(const LLSD& param)
{
std::string url = param.asString();
@@ -8489,6 +8506,8 @@ void initialize_menus()
//Develop (Texture Fetch Debug Console)
view_listener_t::addMenu(new LLDevelopTextureFetchDebugger(), "Develop.SetTexFetchDebugger");
+ //Develop (clear cache immediately)
+ commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) );
// Admin >Object
view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy");
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index f250e40ac6..d8f9ecf248 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1898,7 +1898,11 @@ LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id)
void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type)
{
+#if 0
mCacheMissList.insert(CacheMissItem(id, miss_type));
+#else
+ mCacheMissList.push_back(CacheMissItem(id, miss_type));
+#endif
}
// Get data packer for this object, if we have cached data
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 15c2b36e38..22936fb103 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -470,6 +470,7 @@ private:
U32 mID; //local object id
LLViewerRegion::eCacheMissType mType; //cache miss type
+#if 0
struct Compare
{
bool operator()(const CacheMissItem& lhs, const CacheMissItem& rhs)
@@ -479,6 +480,9 @@ private:
};
typedef std::set<CacheMissItem, Compare> cache_miss_list_t;
+#else
+ typedef std::list<CacheMissItem> cache_miss_list_t;
+#endif
};
CacheMissItem::cache_miss_list_t mCacheMissList;
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 5f112675dc..a08e01784c 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -563,13 +563,19 @@ void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version)
}
}
-void LLVOCache::removeCache(ELLPath location)
+void LLVOCache::removeCache(ELLPath location, bool started)
{
+ if(started)
+ {
+ removeCache();
+ return;
+ }
+
if(mReadOnly)
{
llwarns << "Not removing cache at " << location << ": Cache is currently in read-only mode." << llendl;
return ;
- }
+ }
llinfos << "about to remove the object cache due to settings." << llendl ;
@@ -592,10 +598,8 @@ void LLVOCache::removeCache()
return ;
}
- llinfos << "about to remove the object cache due to some error." << llendl ;
-
std::string mask = "*";
- llinfos << "Removing cache at " << mObjectCacheDirName << llendl;
+ llinfos << "Removing object cache at " << mObjectCacheDirName << llendl;
gDirUtilp->deleteFilesInDir(mObjectCacheDirName, mask);
clearCacheInMemory() ;
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 64eb876919..c26bebb451 100644
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -199,7 +199,7 @@ public:
~LLVOCache() ;
void initCache(ELLPath location, U32 size, U32 cache_version) ;
- void removeCache(ELLPath location) ;
+ void removeCache(ELLPath location, bool started = false) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, BOOL full_region_cache_probe);
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 2f0acba23e..a52c2b3192 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2750,6 +2750,16 @@
function="ToggleControl"
parameter="RenderHoverGlowEnable" />
</menu_item_check>
+ <menu_item_separator />
+
+ <menu_item_call
+ enabled="true"
+ label="Clear Cache Immediately"
+ name="Cache Clear">
+ <menu_item_call.on_click
+ function="Develop.ClearCache" />
+ </menu_item_call>
+
</menu>
<menu