close method Null safety

void close()

Closes the Realm.

All RealmObjects and Realm collections are invalidated and can not be used. This method will not throw if called multiple times.

Implementation

void close() {
  _syncSession?.handle.release();
  _syncSession = null;

  _subscriptions?.handle.release();
  _subscriptions = null;

  realmCore.closeRealm(this);
}