Question: Dynamic Bitmap Cache and Memory Used
Hello all,
I create a custom container in TouchGfxDesigner and I want to used Dynamic Bitmap Cache and Memory:
class Knob : public KnobBase
{
public:
Knob()
{
Bitmap::cache(BITMAP_ENTER_1_ID);
Bitmap::cache(BITMAP_ENTER_2_ID);
pbuf = new uint8_t[1024];
}
virtual ~Knob()
{
Bitmap::cacheRemoveBitmap(BITMAP_ENTER_1_ID);
Bitmap::cacheRemoveBitmap(BITMAP_ENTER_2_ID);
delete[] pbuf;
}
virtual void initialize();
protected:
uint8_t *pbuf;
};
I cache bitmap and request memory in constructor and release them in destructor.
Are there any risks in using it here? I've been worrying about memory leaks.
