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
commit c96fc380e5

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;
}
}
}