From 0d0d579732267b1c153c6abff812abd7408919be Mon Sep 17 00:00:00 2001 From: Halil Durmus Date: Fri, 1 Dec 2023 01:08:48 +0300 Subject: [PATCH] fix!(windows_foundation): remove `refCount` function `refCount` function is available in the `win32` package --- packages/windows_foundation/lib/src/helpers.dart | 7 ------- packages/windows_foundation/test/helpers_test.dart | 9 --------- 2 files changed, 16 deletions(-) diff --git a/packages/windows_foundation/lib/src/helpers.dart b/packages/windows_foundation/lib/src/helpers.dart index 5e8763d6..e931f247 100644 --- a/packages/windows_foundation/lib/src/helpers.dart +++ b/packages/windows_foundation/lib/src/helpers.dart @@ -127,10 +127,3 @@ const _isFlutter = const bool.fromEnvironment('dart.library.ui'); /// If the program is running in Flutter, [GetShellWindow] is used; otherwise, /// [GetConsoleWindow] is used instead. int getWindowHandle() => _isFlutter ? GetShellWindow() : GetConsoleWindow(); - -/// Gets the reference count of the Windows Runtime [object]. -int refCount(IInspectable object) { - object.addRef(); - final refCount = object.release(); - return refCount; -} diff --git a/packages/windows_foundation/test/helpers_test.dart b/packages/windows_foundation/test/helpers_test.dart index 32239a19..85ea076b 100644 --- a/packages/windows_foundation/test/helpers_test.dart +++ b/packages/windows_foundation/test/helpers_test.dart @@ -54,14 +54,5 @@ void main() { expect(getWindowHandle(), isZero); }); - test('refCount', () { - final propertySet = PropertySet(); - expect(refCount(propertySet), 1); - propertySet.addRef(); - expect(refCount(propertySet), 2); - propertySet.release(); - expect(refCount(propertySet), 1); - }); - tearDownAll(forceGC); }