From eb9f19dabdbe80dd047069edc8e1d04e906e7529 Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Mon, 17 Jan 2011 18:52:24 +0100 Subject: VWR-24520: Don't use pkg_check_modules( ... QUIET ) on CMake < 2.8.2 CMake before 2.8.2 doesn't support QUIET for pkg_check_modules(), yet. Credit goes to Aleric, 'cause he told me what to change. --- indra/cmake/FindLLQtWebkit.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/FindLLQtWebkit.cmake b/indra/cmake/FindLLQtWebkit.cmake index c747ec32a2..4bf5f5cb73 100644 --- a/indra/cmake/FindLLQtWebkit.cmake +++ b/indra/cmake/FindLLQtWebkit.cmake @@ -22,9 +22,9 @@ if (PKG_CONFIG_FOUND) else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION) set(_PACKAGE_ARGS libllqtwebkit) endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION) - if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS "2.8") + if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.2") # As virtually nobody will have a pkg-config file for this, do this check always quiet. - # Unfortunately cmake 2.8 or higher is required for pkg_check_modules to have a 'QUIET'. + # Unfortunately cmake 2.8.2 or higher is required for pkg_check_modules to have a 'QUIET'. set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET) endif () pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS}) -- cgit v1.2.3 From 5b90db03d720ca7aed354e43651b9495fb58d04f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 23 Feb 2011 18:51:29 -0500 Subject: STORM-1020 It is sometimes necessary to press ALT+CTRL+D twice to get the Debug menu on the login screen --- indra/newview/llstartup.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0eac7d5e2a..bf712d619d 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -775,6 +775,7 @@ bool idle_startup() gViewerWindow->setNormalControlsVisible( FALSE ); gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); + show_debug_menus(); // Hide the splash screen LLSplashScreen::hide(); -- cgit v1.2.3 From ce975c7572b8253beb07662cddff913b7eabc1e3 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 23 Feb 2011 18:58:28 -0500 Subject: STORM-1020 Use tabs instead of spaces in fix. --- indra/newview/llstartup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bf712d619d..f8f9f3ab86 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -775,7 +775,7 @@ bool idle_startup() gViewerWindow->setNormalControlsVisible( FALSE ); gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); - show_debug_menus(); + show_debug_menus(); // Hide the splash screen LLSplashScreen::hide(); -- cgit v1.2.3 From e64096da697d57d5b00f79ecda649ed76d4a70ba Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 7 Mar 2011 15:02:48 -0700 Subject: fix for STORM-1026: Viewer crahes while trying to reset Graphics quality. reviewed by davep --- indra/llrender/llvertexbuffer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 7b5907a668..b515e4fcab 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -310,7 +310,18 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const //static void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping) { - sEnableVBOs = use_vbo; + sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ; + if(sEnableVBOs) + { + llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. + + llinfos << "VBO is enabled." << llendl ; + } + else + { + llinfos << "VBO is disabled." << llendl ; + } + sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ; LLGLNamePool::registerPool(&sDynamicVBOPool); LLGLNamePool::registerPool(&sDynamicIBOPool); -- cgit v1.2.3 From ec6092c3210e19e92f9309abcf25de95dbd4346a Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 7 Mar 2011 18:10:28 -0700 Subject: fix for STORM-1046:[crashhunters] crash in LWorld::removeRegion STORM-1014: Viewer crash in LLSurface::getWaterHeight STORM-1047:[crashhunters] crash at LLViewerObjectList::renderObjectsForMap --- indra/newview/llviewerobjectlist.cpp | 56 ++++++++++++++++++++++++++++++++---- indra/newview/llviewerobjectlist.h | 4 +-- indra/newview/llworld.cpp | 4 ++- 3 files changed, 55 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 82bc164021..81479e8b49 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -884,13 +884,14 @@ void LLViewerObjectList::clearDebugText() void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) { LLMemType mt(LLMemType::MTYPE_OBJECT); - if (mDeadObjects.count(objectp->mID)) + if (mDeadObjects.find(objectp->mID) != mDeadObjects.end()) { - llinfos << "Object " << objectp->mID << " already on dead list, ignoring cleanup!" << llendl; - return; + llinfos << "Object " << objectp->mID << " already on dead list!" << llendl; + } + else + { + mDeadObjects.insert(objectp->mID); } - - mDeadObjects.insert(std::pair >(objectp->mID, objectp)); // Cleanup any references we have to this object // Remove from object map so noone can look it up. @@ -1140,6 +1141,45 @@ bool LLViewerObjectList::hasMapObjectInRegion(LLViewerRegion* regionp) return false ; } +//make sure the region is cleaned up. +void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) +{ + std::set dead_object_list ; + std::set region_object_list ; + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + { + LLViewerObject* objectp = *iter; + + if(objectp->isDead()) + { + dead_object_list.insert(objectp) ; + } + else if(objectp->getRegion() == regionp) + { + region_object_list.insert(objectp) ; + } + } + + if(dead_object_list.size() > 0) + { + llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ; + + for(std::set::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter) + { + cleanupReferences(*iter) ; + } + } + if(region_object_list.size() > 0) + { + llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ; + + for(std::set::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter) + { + (*iter)->markDead() ; + } + } +} + void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" ); @@ -1159,7 +1199,11 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLViewerObject* objectp = *iter; - llassert_always(!objectp->isDead()); + //llassert_always(!objectp->isDead()); + if(objectp->isDead())//some dead objects somehow not cleaned. + { + continue ; + } if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) { diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 8cff8e988a..22a7f97c38 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -88,6 +88,7 @@ public: void shiftObjects(const LLVector3 &offset); bool hasMapObjectInRegion(LLViewerRegion* regionp) ; + void clearAllMapObjectsInRegion(LLViewerRegion* regionp) ; void renderObjectsForMap(LLNetMap &netmap); void renderObjectBounds(const LLVector3 ¢er); @@ -181,8 +182,7 @@ protected: vobj_list_t mMapObjects; - typedef std::map > vo_map; - vo_map mDeadObjects; // Need to keep multiple entries per UUID + std::set mDeadObjects; std::map > mUUIDObjectMap; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 481148ba4e..8f7197c607 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -282,7 +282,9 @@ void LLWorld::removeRegion(const LLHost &host) updateWaterObjects(); - llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ; + //double check all objects of this region are removed. + gObjectList.clearAllMapObjectsInRegion(regionp) ; + //llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ; } -- cgit v1.2.3 From e841d62f81f70cf100083f484a130ee40666656a Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 7 Mar 2011 18:10:28 -0700 Subject: fix for STORM-1046:[crashhunters] crash in LWorld::removeRegion STORM-1014: Viewer crash in LLSurface::getWaterHeight STORM-1047:[crashhunters] crash at LLViewerObjectList::renderObjectsForMap --- indra/newview/llviewerobjectlist.cpp | 40 +++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 81479e8b49..7bd8875989 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1180,6 +1180,45 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) } } +//make sure the region is cleaned up. +void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) +{ + std::set dead_object_list ; + std::set region_object_list ; + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + { + LLViewerObject* objectp = *iter; + + if(objectp->isDead()) + { + dead_object_list.insert(objectp) ; + } + else if(objectp->getRegion() == regionp) + { + region_object_list.insert(objectp) ; + } + } + + if(dead_object_list.size() > 0) + { + llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ; + + for(std::set::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter) + { + cleanupReferences(*iter) ; + } + } + if(region_object_list.size() > 0) + { + llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ; + + for(std::set::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter) + { + (*iter)->markDead() ; + } + } +} + void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" ); @@ -1199,7 +1238,6 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLViewerObject* objectp = *iter; - //llassert_always(!objectp->isDead()); if(objectp->isDead())//some dead objects somehow not cleaned. { continue ; -- cgit v1.2.3 From b319e255988b55121d08337f99436cc37a7797d8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 8 Mar 2011 11:52:28 -0700 Subject: fix for STORM-1049: [crashhunters] crash at LLViewerFetchedTexture::forceToSaveRawImage(int,bool) --- indra/newview/llviewertexture.cpp | 4 +--- indra/newview/llviewertexture.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index cd16b15e3e..cf7f3f80ad 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2691,12 +2691,10 @@ void LLViewerFetchedTexture::saveRawImage() mLastReferencedSavedRawImageTime = sCurrentTime ; } -void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, bool from_callback) +void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard) { if(!mForceToSaveRawImage || mDesiredSavedRawDiscardLevel < 0 || mDesiredSavedRawDiscardLevel > desired_discard) { - llassert_always(from_callback || mBoostLevel == LLViewerTexture::BOOST_PREVIEW) ; - mForceToSaveRawImage = TRUE ; mDesiredSavedRawDiscardLevel = desired_discard ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b5636bbdc7..d512f8ec3a 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -465,7 +465,7 @@ public: S32 getCachedRawImageLevel() const {return mCachedRawDiscardLevel;} BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;} BOOL isRawImageValid()const { return mIsRawImageValid ; } - void forceToSaveRawImage(S32 desired_discard = 0, bool from_callback = false) ; + void forceToSaveRawImage(S32 desired_discard = 0) ; /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; -- cgit v1.2.3 From 9f765cdb1302e1aa3b06c8203c9f4851fb3e97e3 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 8 Mar 2011 14:20:14 -0700 Subject: fix for STORM-1052: crash at LLVOCacheEntry::~LLVOCacheEntry() line 138 --- indra/newview/llvocache.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index a933500706..b888a263d0 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -71,6 +71,7 @@ LLVOCacheEntry::LLVOCacheEntry() } LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) + : mBuffer(NULL) { S32 size = -1; BOOL success; @@ -135,7 +136,10 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) LLVOCacheEntry::~LLVOCacheEntry() { - delete [] mBuffer; + if(mBuffer) + { + delete[] mBuffer; + } } -- cgit v1.2.3 From 55694cb241a4970b4ba560eae5642314a1308d56 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 8 Mar 2011 14:59:40 -0700 Subject: fix for STORM-1053: crash at LLTextureCache::writeToCache --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a23f809b71..327a5ad698 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1677,8 +1677,8 @@ bool LLAppViewer::cleanup() // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies - sTextureCache->shutdown(); sTextureFetch->shutdown(); + sTextureCache->shutdown(); sImageDecodeThread->shutdown(); sTextureFetch->shutDownTextureCacheThread() ; -- cgit v1.2.3 From 075b1af62aa104b888db10643463bfebb85b6080 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 Mar 2011 17:00:39 -0800 Subject: STORM-1026 : Suppress trivial assert that makes Mac build fail (warning treated as error) --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b515e4fcab..1beb74eca6 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -313,7 +313,7 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping) sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ; if(sEnableVBOs) { - llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. + //llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. llinfos << "VBO is enabled." << llendl ; } -- cgit v1.2.3 From c790866e46ad438c38476f33c95db8c5eabfa5c1 Mon Sep 17 00:00:00 2001 From: Ricky Curtice Date: Thu, 10 Mar 2011 12:06:59 -0800 Subject: Corrected a call to the mac-specific command "Rez" that had the wrong case. This is only an issue on Macs that have a case-sensitive root filesystem. --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1722c84d34..4c4b90855c 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -803,7 +803,7 @@ class DarwinManifest(ViewerManifest): self.run_command('SetFile -a V %r' % pathname) # Create the alias file (which is a resource file) from the .r - self.run_command('rez %r -o %r' % + self.run_command('Rez %r -o %r' % (self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"), os.path.join(volpath, "Applications"))) -- cgit v1.2.3 From ca55bce3ab277b08a595ade7e1ba0c343f2df205 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 10 Mar 2011 19:14:42 -0500 Subject: correct merge error in llviewerobjectlist.cpp --- indra/newview/llviewerobjectlist.cpp | 38 ------------------------------------ 1 file changed, 38 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 7bd8875989..979d91cfcb 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1180,44 +1180,6 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) } } -//make sure the region is cleaned up. -void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) -{ - std::set dead_object_list ; - std::set region_object_list ; - for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) - { - LLViewerObject* objectp = *iter; - - if(objectp->isDead()) - { - dead_object_list.insert(objectp) ; - } - else if(objectp->getRegion() == regionp) - { - region_object_list.insert(objectp) ; - } - } - - if(dead_object_list.size() > 0) - { - llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ; - - for(std::set::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter) - { - cleanupReferences(*iter) ; - } - } - if(region_object_list.size() > 0) - { - llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ; - - for(std::set::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter) - { - (*iter)->markDead() ; - } - } -} void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { -- cgit v1.2.3 From c556efbce8e093883a7c7474b1cdac0d53c39cfb Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 10 Mar 2011 20:21:40 -0500 Subject: increment patch release --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 5a134b5009..15e3ffe1da 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 5; -const S32 LL_VERSION_PATCH = 1; +const S32 LL_VERSION_PATCH = 2; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From 1426765e82549ec9d17a0f90d902f25c0e785bbd Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 10 Mar 2011 20:27:45 -0500 Subject: increment version to 2.5.3 --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 15e3ffe1da..3838b2b16c 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 5; -const S32 LL_VERSION_PATCH = 2; +const S32 LL_VERSION_PATCH = 3; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3 From 005da00fff65e48c47801982cb3ff2ff45ee8985 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 11 Mar 2011 14:38:09 -0800 Subject: STORM-1059 : Fix for cache purging (fix by Aleric) --- indra/newview/lltexturecache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f54214b95c..7fb52c1939 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1419,22 +1419,21 @@ void LLTextureCache::readHeaderCache() } } } - if (num_entries > sCacheMaxEntries) + if (num_entries - empty_entries > sCacheMaxEntries) { // Special case: cache size was reduced, need to remove entries // Note: After we prune entries, we will call this again and create the LRU - U32 entries_to_purge = (num_entries-empty_entries) - sCacheMaxEntries; + U32 entries_to_purge = (num_entries - empty_entries) - sCacheMaxEntries; llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; - if (entries_to_purge > 0) + // We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have: + // purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge + // So, it's certain that iter will never reach lru.end() first. + std::set::iterator iter = lru.begin(); + while (purge_list.size() < entries_to_purge) { - for (std::set::iterator iter = lru.begin(); iter != lru.end(); ++iter) - { - purge_list.insert(iter->second); - if (purge_list.size() >= entries_to_purge) - break; - } + purge_list.insert(iter->second); + ++iter; } - llassert_always(purge_list.size() >= entries_to_purge); } else { -- cgit v1.2.3 From 16443c4df389b5d43bae129ba64d4311f5625ca3 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 11 Mar 2011 15:09:44 -0800 Subject: STORM-1001 : Fix ObjectMedia cap flooding (Fix by Kitty Barnett) --- indra/llprimitive/lltextureentry.cpp | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 861bde5c89..34eff17519 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -423,24 +423,10 @@ S32 LLTextureEntry::setBumpShinyFullbright(U8 bump) S32 LLTextureEntry::setMediaTexGen(U8 media) { - if (mMediaFlags != media) - { - mMediaFlags = media; - - // Special code for media handling - if( hasMedia() && mMediaEntry == NULL) - { - mMediaEntry = new LLMediaEntry; - } - else if ( ! hasMedia() && mMediaEntry != NULL) - { - delete mMediaEntry; - mMediaEntry = NULL; - } - - return TEM_CHANGE_MEDIA; - } - return TEM_CHANGE_NONE; + S32 result = TEM_CHANGE_NONE; + result |= setTexGen(media & TEM_TEX_GEN_MASK); + result |= setMediaFlags(media & TEM_MEDIA_MASK); + return result; } S32 LLTextureEntry::setBumpmap(U8 bump) -- cgit v1.2.3