1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Change RID_Owner::get_owned_list.

This commit is contained in:
Yyf2333
2025-01-21 21:23:46 +08:00
committed by Yufeng Ying
parent 2d3bdcac35
commit 1a70a06a43
11 changed files with 74 additions and 102 deletions

View File

@@ -2670,16 +2670,15 @@ bool RendererCanvasCull::free(RID p_rid) {
template <typename T>
void RendererCanvasCull::_free_rids(T &p_owner, const char *p_type) {
List<RID> owned;
p_owner.get_owned_list(&owned);
LocalVector<RID> owned = p_owner.get_owned_list();
if (owned.size()) {
if (owned.size() == 1) {
WARN_PRINT(vformat("1 RID of type \"%s\" was leaked.", p_type));
} else {
WARN_PRINT(vformat("%d RIDs of type \"%s\" were leaked.", owned.size(), p_type));
}
for (const RID &E : owned) {
free(E);
for (const RID &rid : owned) {
free(rid);
}
}
}