mirror of
https://github.com/edubart/otclient.git
synced 2025-12-23 00:27:12 +01:00
Fix memory leaks
* Fix recursive reference memory leak in UIWidget * Make Event/ScheduledEvent memory-leak safe * Fix exit crashs by freeing graphics resources before destroying GL context * Add many asserts to avoid any leak regression
This commit is contained in:
@@ -28,12 +28,17 @@
|
||||
class TextureManager
|
||||
{
|
||||
public:
|
||||
TexturePtr getTexture(const std::string& fileName);
|
||||
void init();
|
||||
void terminate();
|
||||
|
||||
static TexturePtr loadPNG(std::stringstream& file);
|
||||
TexturePtr getTexture(const std::string& fileName);
|
||||
const TexturePtr& getEmptyTexture() { return m_emptyTexture; }
|
||||
|
||||
private:
|
||||
TexturePtr loadPNG(std::stringstream& file);
|
||||
|
||||
std::unordered_map<std::string, TextureWeakPtr> m_textures;
|
||||
TexturePtr m_emptyTexture;
|
||||
};
|
||||
|
||||
extern TextureManager g_textures;
|
||||
|
||||
Reference in New Issue
Block a user