mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
* g_extrusion_mesh_cache new() and grab() to be managed in constuctor only (#7235 partial) This global was getting grab()-ed by each call to getItemMesh, incrementing its reference count. What was to be the final drop() in the destructor ended up with > 0 reference count, so memory not freed by Irrlicht.
This commit is contained in:
parent
ba91624d8c
commit
5862d9e482
@ -501,11 +501,7 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
|
||||
const ContentFeatures &f = ndef->get(def.name);
|
||||
content_t id = ndef->getId(def.name);
|
||||
|
||||
if (!g_extrusion_mesh_cache) {
|
||||
g_extrusion_mesh_cache = new ExtrusionMeshCache();
|
||||
} else {
|
||||
g_extrusion_mesh_cache->grab();
|
||||
}
|
||||
FATAL_ERROR_IF(!g_extrusion_mesh_cache, "Extrusion mesh cache is not yet initialized");
|
||||
|
||||
scene::SMesh *mesh = nullptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user