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

Commit

Permalink
fix(winrtgen): close the MetadataStore once we're done (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
halildurmus authored Sep 15, 2023
1 parent 1b11cfa commit dbc4005
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/winrtgen/bin/add_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ void main(List<String> args) async {
print(e.message);
print('');
printUsage(argParser);
} finally {
WinRTMetadataStore.close();
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/winrtgen/bin/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ void main() async {
print('[${stopwatch.elapsed}] Generating library exports...');
generateLibraryExports();

WinRTMetadataStore.close();
stopwatch.stop();
print('[${stopwatch.elapsed}] Completed');
}
3 changes: 3 additions & 0 deletions packages/winrtgen/lib/src/models/winrt_metadata_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ final class WinRTMetadataStore {
.typeDefs
.where((typeDef) => typeDef.name.startsWith(namespace))
.toList();

/// Closes the [MetadataStore].
static void close() => MetadataStore.close();
}

/// Represents the Windows Runtime namespaces.
Expand Down
4 changes: 2 additions & 2 deletions packages/winrtgen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
crypto: ^3.0.3

# For formatting Dart code (APIs for performing dart format)
dart_style: ^2.3.2
dart_style: ^2.3.3

# Foreign Function Interface extension methods
ffi: ^2.1.0
Expand All @@ -30,7 +30,7 @@ dependencies:
pool: ^1.5.1

# Windows metadata for automatically generating API signatures
winmd: ^4.0.0
winmd: ^4.0.1

win32: ^5.0.7

Expand Down

0 comments on commit dbc4005

Please sign in to comment.