From a6e806f6888070f4e2c11486f7eb0e98cca1937c Mon Sep 17 00:00:00 2001 From: Thomas Burkhart Date: Wed, 29 May 2024 19:57:19 +0200 Subject: [PATCH] 8.0.0-pre-2 --- CHANGELOG.md | 3 ++- example/pubspec.lock | 16 ++++++++-------- lib/get_it_impl.dart | 5 ++++- pubspec.yaml | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d794646..e09ddcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## [8.0.0-pre-1] - 07.05.2024 +## [8.0.0-pre-2] - 29.05.2024 fixing negitiv reference count +## [8.0.0-pre-1] - 26.05.2024 * `getAll()` and `getAllAsync()` now have a `fromAllScopes` parameter. * adding safeguards according to https://github.com/fluttercommunity/get_it/issues/364 to make it impossilble to call `push/popScope` while the `init()` function of another pushScope is running. * fixed an usafe type check when using a runtime type to acess an object in get_it. diff --git a/example/pubspec.lock b/example/pubspec.lock index 77fea90..caf3e20 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -124,7 +124,7 @@ packages: path: ".." relative: true source: path - version: "7.7.0" + version: "8.0.0-pre-1" glob: dependency: transitive description: @@ -201,10 +201,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -406,10 +406,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -435,4 +435,4 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/lib/get_it_impl.dart b/lib/get_it_impl.dart index e762337..648789a 100644 --- a/lib/get_it_impl.dart +++ b/lib/get_it_impl.dart @@ -860,9 +860,12 @@ class _GetItImplementation implements GetIt { final registerdFactory = _findFirstFactoryByInstanceOrNull(instance); if (registerdFactory != null) { if (registerdFactory._refenceCount < 1) { + assert(registerdFactory._refenceCount == 0, + 'GetIt: releaseInstance was called on an object that was already released'); unregister(instance: instance); + } else { + registerdFactory._refenceCount--; } - registerdFactory._refenceCount--; } } diff --git a/pubspec.yaml b/pubspec.yaml index d1c7963..5cfebb2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: get_it description: Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App" -version: 8.0.0-pre-1 +version: 8.0.0-pre-2 maintainer: Thomas Burkhart (@escamoteur) homepage: https://github.com/fluttercommunity/get_it funding: