diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 19:46:48 +0200 |
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-03-02 19:46:48 +0200 |
| commit | f90d17905899d01db76b82b6d647bbecf1c47f23 (patch) | |
| tree | dba8f9a514a02a9d86fe25c5d0ffccf30a6b754f /indra/llimage | |
| parent | 064f28b290026be0e77cd38de78b06477a9c0876 (diff) | |
| parent | 97a103255e433629f13e2156aa307ca329cdcfc6 (diff) | |
Merge branch 'DRTVWR-546' into DRTVWR-539
# Conflicts:
# indra/llcommon/tests/llprocess_test.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llcombobox.h
# indra/newview/VIEWER_VERSION.txt
# indra/newview/llviewertexturelist.cpp
# indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llimage')
| -rw-r--r-- | indra/llimage/llimage.cpp | 6 | ||||
| -rw-r--r-- | indra/llimage/llimage.h | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 15b07e5318..5fa19ce9c6 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -860,6 +860,12 @@ U8* LLImageRaw::reallocateData(S32 size) return res; } +void LLImageRaw::releaseData() +{ + LLImageBase::setSize(0, 0, 0); + LLImageBase::setDataAndSize(nullptr, 0); +} + // virtual void LLImageRaw::deleteData() { diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 354926ee58..7a588cfb03 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -191,6 +191,12 @@ public: /*virtual*/ void deleteData(); /*virtual*/ U8* allocateData(S32 size = -1); /*virtual*/ U8* reallocateData(S32 size); + + // use in conjunction with "no_copy" constructor to release data pointer before deleting + // so that deletion of this LLImageRaw will not free the memory at the "data" parameter + // provided to "no_copy" constructor + void releaseData(); + bool resize(U16 width, U16 height, S8 components); |
