diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed7c3167..de5944fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ * Support setting logger on Realm class. Default is to print info message or worse to the console. ([#583](https://github.com/realm/realm-dart/pull/583)) * Support SyncErrorHandler in FlexibleSyncConfiguration. ([#577](https://github.com/realm/realm-dart/pull/577)) * Support SyncClientResetHandler in FlexibleSyncConfiguration. ([#608](https://github.com/realm/realm-dart/pull/608)) +* [Dart] Added `Realm.Shutdown` method to allow normal process exit in Dart applications. ([#617](https://github.com/realm/realm-dart/pull/617)) ### Fixed diff --git a/lib/src/app.dart b/lib/src/app.dart index 2ab397b71..c03db166f 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -17,7 +17,6 @@ //////////////////////////////////////////////////////////////////////////////// import 'dart:io'; -import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import '../realm.dart'; diff --git a/lib/src/collections.dart b/lib/src/collections.dart index 20bfd698b..f62a30d10 100644 --- a/lib/src/collections.dart +++ b/lib/src/collections.dart @@ -1,4 +1,3 @@ -import 'realm_class.dart'; import 'native/realm_core.dart'; /// Contains index information about objects that moved within the same collection. diff --git a/lib/src/realm_class.dart b/lib/src/realm_class.dart index ad6f3701f..38ec14641 100644 --- a/lib/src/realm_class.dart +++ b/lib/src/realm_class.dart @@ -316,7 +316,10 @@ class Realm { ..level = RealmLogLevel.info ..onRecord.listen((event) => print(event)); - /// Shutdown. + /// Used to shutdown Realm and allow the process to correctly release native resources and exit. + /// + /// Disclaimer: This method is mostly needed on Dart standalone and if not called the Dart probram will hang and not exit. + /// This is a workaround of a Dart VM bug and will be removed in a future version of the SDK. static void shutdown() => scheduler.stop(); }