diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 23:08:01 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-18 23:08:01 +0100 |
commit | 80b3813b1505a6bd195c0b0aac1555a7969e59c9 (patch) | |
tree | 26f4adcebb64ec985f6193e73d7adb45b9c8965d /scene/resources/shape_2d.cpp | |
parent | a66fc4cf7ebd155ee475bc69863b47081119d965 (diff) | |
parent | 5704055d30499cc63672d44001760a98abfbfc08 (diff) |
Merge pull request #67714 from adamscott/fix-preload-cyclic-references-part2
Fix cyclic references in GDScript 2.0
Diffstat (limited to 'scene/resources/shape_2d.cpp')
-rw-r--r-- | scene/resources/shape_2d.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index af84144591..413670d23e 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -124,5 +124,7 @@ Shape2D::Shape2D(const RID &p_rid) { } Shape2D::~Shape2D() { - PhysicsServer2D::get_singleton()->free(shape); + if (PhysicsServer2D::get_singleton() != nullptr) { + PhysicsServer2D::get_singleton()->free(shape); + } } |