simon.wade Posted May 9 Share Posted May 9 Hey everybody! I have a feeling that WidgetCanvas might not properly free the resources used when assigning an Image to a polygon. We have some UnigineScript (I know! We really need to move away from it...) that looked something like this: class Foo { private: WidgetCanvas m_canvas = 0; Image m_image = 0; public: Foo(string filename) { // <some code here to construct m_canvas and create a polygon> m_image = new Image(filename); m_canvas.setPolygonImage(polygon_id, m_image); } ~Foo() { delete m_canvas; delete m_image; } }; And it seemed like we kept leaking resources until we added m_canvas.clear() to the destructor. I can probably put together a proper example if needed, but hopefully it's something really obvious in the source. Fingers crossed. Link to comment
silent Posted May 13 Share Posted May 13 Hi Simon, Yeah, so far you can clear resources in destructor and you should be safe :) We will take a closer look at this bug and will fix it in the upcoming 2.19 release. Thank you! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts