diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-06 16:11:21 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-06 16:11:21 +0100 |
commit | 9bd7ad53f7d8b53bb2fa5185f782b6369e38c24a (patch) | |
tree | cf9a049ed4a72377f096c80681b047be5e7fd1b6 /scene/resources | |
parent | 6717c4cad2a670fda588d11a27132452a1301ad6 (diff) | |
parent | 88f3045301470fd13bbe3ade6537a1c1cb1227fe (diff) |
Merge pull request #69506 from adamscott/move-gdscript-uninit-to-finalize
Move GDScript uninitialization to `GDScriptLanguage::finish()`
Diffstat (limited to 'scene/resources')
-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); } |