mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing some bad memory usage
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <core/graphics.h>
|
||||
#include <iostream>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
@@ -64,4 +63,17 @@ namespace mlx
|
||||
MLX_PROFILE_FUNCTION();
|
||||
_text_manager.loadFont(*_renderer, filepath, scale);
|
||||
}
|
||||
|
||||
void GraphicsSupport::tryEraseTextureFromManager(Texture* texture) noexcept
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
for(auto it = _drawlist.begin(); it != _drawlist.end();)
|
||||
{
|
||||
if(_texture_manager.isTextureKnown(texture))
|
||||
it = _drawlist.erase(it);
|
||||
else
|
||||
++it;
|
||||
}
|
||||
_texture_manager.eraseTextures(texture);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user