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

@ -47,6 +47,7 @@ bool RendererCompositor::is_xr_enabled() const {
}
RendererCompositor::RendererCompositor() {
ERR_FAIL_COND_MSG(singleton != nullptr, "A RendererCompositor singleton already exists.");
singleton = this;
#ifndef _3D_DISABLED
@ -57,3 +58,7 @@ RendererCompositor::RendererCompositor() {
}
#endif // _3D_DISABLED
}
RendererCompositor::~RendererCompositor() {
singleton = nullptr;
}