1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Merge pull request #11650 from kitsune/fix-range-unshare-crash

Fix crash when unsharing a range that is not shared
This commit is contained in:
Poommetee Ketson
2017-10-02 23:48:59 +07:00
committed by GitHub

View File

@@ -208,10 +208,12 @@ void Range::_ref_shared(Shared *p_shared) {
void Range::_unref_shared() {
shared->owners.erase(this);
if (shared->owners.size() == 0) {
memdelete(shared);
shared = NULL;
if (shared) {
shared->owners.erase(this);
if (shared->owners.size() == 0) {
memdelete(shared);
shared = NULL;
}
}
}