summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-07-21 11:27:55 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-07-21 11:27:55 -0400
commit25330b47f961b68df046665ce0576e6f23d1f3e5 (patch)
treedb84983b338972d1c332b45742c643f9d18c3fe3 /indra/llrender/llimagegl.cpp
parent248f78b45ec9ee275f3b97e50b9962f2e54dbde2 (diff)
parentec4135da63a3f3877222fba4ecb59b15650371fe (diff)
SL-18837: Merge branch 'main' of secondlife/viewer into actions
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 9dc140b5b9..465f30a343 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -859,9 +859,16 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32
stop_glerror();
if (prev_mip_data)
- delete[] prev_mip_data;
+ {
+ if (prev_mip_data != cur_mip_data)
+ delete[] prev_mip_data;
+ prev_mip_data = nullptr;
+ }
if (cur_mip_data)
+ {
delete[] cur_mip_data;
+ cur_mip_data = nullptr;
+ }
mGLTextureCreated = false;
return FALSE;