mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Free dummy renderer objects
These leaked during tests etc.
This commit is contained in:
parent
fa48a51183
commit
666daf47c3
@ -76,6 +76,8 @@ public:
|
||||
|
||||
/* SHADER API */
|
||||
|
||||
bool owns_shader(RID p_rid) { return shader_owner.owns(p_rid); }
|
||||
|
||||
virtual RID shader_allocate() override;
|
||||
virtual void shader_initialize(RID p_rid) override;
|
||||
virtual void shader_free(RID p_rid) override;
|
||||
|
@ -138,6 +138,8 @@ public:
|
||||
|
||||
/* MULTIMESH API */
|
||||
|
||||
bool owns_multimesh(RID p_rid) { return multimesh_owner.owns(p_rid); }
|
||||
|
||||
virtual RID multimesh_allocate() override;
|
||||
virtual void multimesh_initialize(RID p_rid) override;
|
||||
virtual void multimesh_free(RID p_rid) override;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#ifndef UTILITIES_DUMMY_H
|
||||
#define UTILITIES_DUMMY_H
|
||||
|
||||
#include "material_storage.h"
|
||||
#include "mesh_storage.h"
|
||||
#include "servers/rendering/storage/utilities.h"
|
||||
#include "texture_storage.h"
|
||||
@ -63,6 +64,12 @@ public:
|
||||
} else if (RendererDummy::MeshStorage::get_singleton()->owns_mesh(p_rid)) {
|
||||
RendererDummy::MeshStorage::get_singleton()->mesh_free(p_rid);
|
||||
return true;
|
||||
} else if (RendererDummy::MeshStorage::get_singleton()->owns_multimesh(p_rid)) {
|
||||
RendererDummy::MeshStorage::get_singleton()->multimesh_free(p_rid);
|
||||
return true;
|
||||
} else if (RendererDummy::MaterialStorage::get_singleton()->owns_shader(p_rid)) {
|
||||
RendererDummy::MaterialStorage::get_singleton()->shader_free(p_rid);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user