summaryrefslogtreecommitdiffstats
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-03 12:22:24 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-03 12:22:24 +0100
commit1b634c06d08c99f176122331f697e6525a76bf01 (patch)
treeb4d51265754a7dd4b63c4fb394649f17ef3bad16 /scene/resources/material.cpp
parent5638fcdd7109e9827bd4f8c05a886eff74bfc021 (diff)
parentea33001b95d57f7b400d78d4b20bef23293d9077 (diff)
downloadredot-engine-1b634c06d08c99f176122331f697e6525a76bf01.tar.gz
Merge pull request #69972 from adamscott/add-server-checks-before-free
Add safety-checks before some servers `free()`
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index a16d2c2072..44ce90cc4a 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -141,6 +141,7 @@ Material::Material() {
}
Material::~Material() {
+ ERR_FAIL_NULL(RenderingServer::get_singleton());
RenderingServer::get_singleton()->free(material);
}
@@ -3005,6 +3006,7 @@ BaseMaterial3D::BaseMaterial3D(bool p_orm) :
}
BaseMaterial3D::~BaseMaterial3D() {
+ ERR_FAIL_NULL(RenderingServer::get_singleton());
MutexLock lock(material_mutex);
if (shader_map.has(current_key)) {