diff options
author | Adam Scott <ascott.ca@gmail.com> | 2022-12-02 13:27:26 -0500 |
---|---|---|
committer | Adam Scott <ascott.ca@gmail.com> | 2022-12-06 09:35:39 -0500 |
commit | 88f3045301470fd13bbe3ade6537a1c1cb1227fe (patch) | |
tree | 1b14193cbf349ab4136fd5bd32fa61712daf9282 /scene | |
parent | f3e6750a7e4702918e05f42b1376e30e652f2f90 (diff) |
Move GDScript uninitialization to `GDScriptLanguage::finalize()`
Co-authored-by: Ricardo Buring <ricardo.buring@gmail.com>
Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/shape_2d.cpp | 5 | ||||
-rw-r--r-- | scene/resources/shape_3d.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 413670d23e..87c6c36ee9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -124,7 +124,6 @@ Shape2D::Shape2D(const RID &p_rid) { } Shape2D::~Shape2D() { - if (PhysicsServer2D::get_singleton() != nullptr) { - PhysicsServer2D::get_singleton()->free(shape); - } + ERR_FAIL_NULL(PhysicsServer2D::get_singleton()); + PhysicsServer2D::get_singleton()->free(shape); } diff --git a/scene/resources/shape_3d.cpp b/scene/resources/shape_3d.cpp index 44f21d2a48..7992ba9fd4 100644 --- a/scene/resources/shape_3d.cpp +++ b/scene/resources/shape_3d.cpp @@ -128,7 +128,6 @@ Shape3D::Shape3D(RID p_shape) : shape(p_shape) {} Shape3D::~Shape3D() { - if (PhysicsServer3D::get_singleton() != nullptr) { - PhysicsServer3D::get_singleton()->free(shape); - } + ERR_FAIL_NULL(PhysicsServer3D::get_singleton()); + PhysicsServer3D::get_singleton()->free(shape); } |