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

fix missing cleanup and null checks for various singletons

This commit is contained in:
rune-scape
2024-06-18 00:30:20 -07:00
parent 8c70c18132
commit 6adcb1373a
6 changed files with 18 additions and 4 deletions

View File

@@ -545,8 +545,13 @@ public:
virtual void set_debug_redraw(bool p_enabled, double p_time, const Color &p_color) = 0;
RendererCanvasRender() { singleton = this; }
virtual ~RendererCanvasRender() {}
RendererCanvasRender() {
ERR_FAIL_COND_MSG(singleton != nullptr, "A RendererCanvasRender singleton already exists.");
singleton = this;
}
virtual ~RendererCanvasRender() {
singleton = nullptr;
}
};
#endif // RENDERER_CANVAS_RENDER_H