diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2009-11-16 15:39:25 -0800 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2009-11-16 15:39:25 -0800 |
commit | 39efc3de51443bf8a0e6167e9f92833f8480968e (patch) | |
tree | a1e17d4e269ef02a28f8c09dd224c3829e0c76ee /indra/newview | |
parent | e4453f9cc8479a4ac3344e68210004dbc39b17db (diff) | |
parent | b62a8c14edb3f30cb39c67d3ad982a809c9ce5e8 (diff) |
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llvlcomposition.cpp | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 85bc26c9c0..0d29efaedf 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2121,10 +2121,11 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level) llassert_always(mGLTexturep.notNull()) ; llassert_always(discard_level >= 0); llassert_always(mComponents > 0); + if (mRawImage.notNull()) { - llerrs << "called with existing mRawImage" << llendl; - mRawImage = NULL; + //mRawImage is in use by somebody else, do not delete it. + return NULL ; } if(mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= discard_level) diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 999701ece1..6340189c93 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -287,17 +287,22 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, min_dim /= 2; } - mDetailTextures[i]->reloadRawImage(ddiscard) ; + BOOL delete_raw = (mDetailTextures[i]->reloadRawImage(ddiscard) != NULL) ; if(mDetailTextures[i]->getRawImageLevel() != ddiscard)//raw iamge is not ready, will enter here again later. { - mDetailTextures[i]->destroyRawImage() ; + if(delete_raw) + { + mDetailTextures[i]->destroyRawImage() ; + } lldebugs << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << llendl; return FALSE; } mRawImages[i] = mDetailTextures[i]->getRawImage() ; - mDetailTextures[i]->destroyRawImage() ; - + if(delete_raw) + { + mDetailTextures[i]->destroyRawImage() ; + } if (mDetailTextures[i]->getWidth(ddiscard) != BASE_SIZE || mDetailTextures[i]->getHeight(ddiscard) != BASE_SIZE || mDetailTextures[i]->getComponents() != 3) |