diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-01-03 22:37:44 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-01-03 22:37:44 -0700 |
commit | d3b9f446a683f71b0d3a70ecf6e0028a063040e4 (patch) | |
tree | 75699fedc7469bed4f411376d4b76d6e708c6eb0 /indra/llimage/llimage.cpp | |
parent | 1d44f4d863217c8e5d18a0073e02e4360bc65e07 (diff) |
fix for MAINT-2147: crash in LLTextureCache::writeToFastCache on OSX
Diffstat (limited to 'indra/llimage/llimage.cpp')
-rw-r--r-- | indra/llimage/llimage.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index a88ac148ef..3f8d1baddd 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -666,8 +666,17 @@ void LLImageRaw::fill( const LLColor4U& color ) } } +LLPointer<LLImageRaw> LLImageRaw::duplicate() +{ + if(getNumRefs() < 2) + { + return this; //nobody else refences to this image, no need to duplicate. + } - + //make a duplicate + LLPointer<LLImageRaw> dup = new LLImageRaw(getData(), getWidth(), getHeight(), getComponents()); + return dup; +} // Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) |