summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-05-03 16:26:32 +0200
committerGitHub <noreply@github.com>2021-05-03 16:26:32 +0200
commiteb57dcdb909dd45eaff6e25858a1907e13df4f59 (patch)
tree08b04f71447251431e66a08cd1cd0974f85f853f
parentbd215f0195d70178908ceac157dfb58d18d7dc31 (diff)
parentbf7c4da804cd11c98218ae1d35da2ae7a9483105 (diff)
Merge pull request #48406 from Calinou/tweak-leaked-rid-messages
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index b664ccdd3c..30cc01fd10 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -7986,7 +7986,11 @@ void RenderingDeviceVulkan::_free_rids(T &p_owner, const char *p_type) {
List<RID> owned;
p_owner.get_owned_list(&owned);
if (owned.size()) {
- WARN_PRINT(itos(owned.size()) + " RIDs of type '" + p_type + "' were leaked.");
+ 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 (List<RID>::Element *E = owned.front(); E; E = E->next()) {
free(E->get());
}
@@ -8199,7 +8203,11 @@ void RenderingDeviceVulkan::finalize() {
List<RID> owned;
texture_owner.get_owned_list(&owned);
if (owned.size()) {
- WARN_PRINT(itos(owned.size()) + " RIDs of type 'Texture' were leaked.");
+ if (owned.size() == 1) {
+ WARN_PRINT("1 RID of type \"Texture\" was leaked.");
+ } else {
+ WARN_PRINT(vformat("%d RIDs of type \"Texture\" were leaked.", owned.size()));
+ }
//free shared first
for (List<RID>::Element *E = owned.front(); E;) {
List<RID>::Element *N = E->next();