summaryrefslogtreecommitdiff
path: root/indra/llrender/llrender2dutils.h
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-08-13 17:22:58 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-08-13 17:22:58 +0300
commit1233842012a257b7eb49eab354bb945593c974ed (patch)
tree0e672d401fe9d1b3fa89ec82134b192b90260fb1 /indra/llrender/llrender2dutils.h
parent5196af8663653fb345394733bf4bf88185a7565a (diff)
SL-11718 Crash in LLRender2D
Diffstat (limited to 'indra/llrender/llrender2dutils.h')
-rw-r--r--indra/llrender/llrender2dutils.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h
index cf408336e6..70ab006fd6 100644
--- a/indra/llrender/llrender2dutils.h
+++ b/indra/llrender/llrender2dutils.h
@@ -139,6 +139,13 @@ public:
LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority = 0);
LLVector2 mGLScaleFactor;
+
+protected:
+ // since LLRender2D has no control of image provider's lifecycle
+ // we need a way to tell LLRender2D that provider died and
+ // LLRender2D needs to be updated.
+ static void resetProvider();
+
private:
LLImageProviderInterface* mImageProvider;
};
@@ -147,11 +154,21 @@ class LLImageProviderInterface
{
protected:
LLImageProviderInterface() {};
- virtual ~LLImageProviderInterface() {};
+ virtual ~LLImageProviderInterface();
public:
virtual LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority) = 0;
virtual LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority) = 0;
virtual void cleanUp() = 0;
+
+ // to notify holders when pointer gets deleted
+ typedef void(*callback_t)();
+ void addOnRemovalCallback(callback_t func);
+ void deleteOnRemovalCallback(callback_t func);
+
+private:
+
+ typedef std::list< callback_t > callback_list_t;
+ callback_list_t mCallbackList;
};