Skip to content

Commit

Permalink
fix: only release enumerator_ when set (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
brysem authored Apr 13, 2021
1 parent c24d150 commit 541721d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions NativeScript/runtime/DictionaryAdapter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,12 @@ - (void)dealloc {
self->isolate_ = nullptr;
self->cache_ = nil;
self->object_ = nil;
CFAutorelease(self->enumerator_);
self->enumerator_ = nullptr;

if (self->enumerator_ != nullptr) {
CFAutorelease(self->enumerator_);
self->enumerator_ = nullptr;
}

[super dealloc];
}

Expand Down

0 comments on commit 541721d

Please sign in to comment.