Fix TileMap memory leak
This commit is contained in:
parent
e4288bf728
commit
48fb43035c
@ -798,8 +798,9 @@ void TileMap::_rendering_cleanup_layer(int p_layer) {
|
|||||||
ERR_FAIL_INDEX(p_layer, (int)layers.size());
|
ERR_FAIL_INDEX(p_layer, (int)layers.size());
|
||||||
|
|
||||||
RenderingServer *rs = RenderingServer::get_singleton();
|
RenderingServer *rs = RenderingServer::get_singleton();
|
||||||
if (!layers[p_layer].canvas_item.is_valid()) {
|
if (layers[p_layer].canvas_item.is_valid()) {
|
||||||
rs->free(layers[p_layer].canvas_item);
|
rs->free(layers[p_layer].canvas_item);
|
||||||
|
layers[p_layer].canvas_item = RID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user