Cinder-UI icon indicating copy to clipboard operation
Cinder-UI copied to clipboard

How to destroy a SuperCanvasRef

Open oogre opened this issue 7 years ago • 0 comments

Hello, I need to be able to create and destroy UI elements on demand. To do so, I do something like this : class ModuleUI { SuperCanvasRef rezaUi; public : ~ModuleUI(){ rezaUi->clear(); rezaUi.reset(); rezaUi = nullptr; } ModuleUI(cinder::ivec2 position){ rezaUi = SuperCanvas::create( "" ); rezaUi->addButton("Bang", false); rezaUi->setOrigin(position); } void draw(); void update(); };

When I try to delete ModuleUI it seems to stay in the memory. The delete process execute the ~ModuleUI() without effect; capture d ecran 2017-10-10 a 16 09 03

oogre avatar Oct 10 '17 14:10 oogre