Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix!(windows_foundation): remove refCount function
Browse files Browse the repository at this point in the history
`refCount` function is available in the `win32` package
  • Loading branch information
halildurmus committed Nov 30, 2023
1 parent cab3a16 commit 0d0d579
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions packages/windows_foundation/lib/src/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 0 additions & 9 deletions packages/windows_foundation/test/helpers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 0d0d579

Please sign in to comment.