summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-07-17 13:37:03 -0700
committerBrad Linden <brad@lindenlab.com>2023-07-17 13:37:03 -0700
commitf975cfd7361729195f2bb14d874e5eacc6140759 (patch)
tree471389ca5dab742aaf84c678c4dcef3433da8e9a /indra/llrender/llimagegl.cpp
parent2f8f1c7a44f45490db5b5f040914e42aef2f5280 (diff)
parentec4135da63a3f3877222fba4ecb59b15650371fe (diff)
Merge remote-tracking branch 'origin/main' into DRTVWR-559
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 3e3a3095e3..b77f98d65e 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -905,9 +905,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;