Skip to content

Commit

Permalink
fix: #108
Browse files Browse the repository at this point in the history
  • Loading branch information
yulingtianxia committed Oct 18, 2022
1 parent 41ae359 commit c01d0bb
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 56 deletions.
2 changes: 1 addition & 1 deletion dart_native/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SPEC CHECKSUMS:
ClassWrittenInSwift: de0543e7c1a836e190af74fddff84ad9b2f3d18c
CocoaLumberjack: 543c79c114dadc3b1aba95641d8738b06b05b646
dart_native: 3ed31c9e40530ad0ae006c0b7cf75a22b24e933f
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c

PODFILE CHECKSUM: 6e9979e89c4dd9698b3ed55a88e6a5100fa0dc38

Expand Down
35 changes: 14 additions & 21 deletions dart_native/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "31.0.0"
version: "22.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.0"
version: "1.7.1"
args:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -98,14 +98,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.0"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -140,7 +140,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
version: "1.15.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -189,7 +189,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.2.0"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -297,21 +297,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.3.0"
mime:
dependency: transitive
description:
Expand All @@ -332,7 +325,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.0"
pedantic:
dependency: transitive
description:
Expand Down Expand Up @@ -393,7 +386,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -435,7 +428,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
version: "0.3.0"
timing:
dependency: transitive
description:
Expand All @@ -456,7 +449,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.0"
watcher:
dependency: transitive
description:
Expand All @@ -479,5 +472,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.2.0"
2 changes: 1 addition & 1 deletion dart_native/ios/Classes/native_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ DN_EXTERN void RegisterDartFinalizer(Dart_Handle h, void *callback, void *key, D

DN_EXTERN void NotifyDeallocToDart(intptr_t address, Dart_Port dartPort);

DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t));
DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t), Dart_Port dartPort);

typedef NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *DartNativeInterfaceMap;
DN_EXTERN NSObject *DNInterfaceHostObjectWithName(char *name);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ DN_EXTERN void RegisterDartFinalizer(Dart_Handle h, void *callback, void *key, D

DN_EXTERN void NotifyDeallocToDart(intptr_t address, Dart_Port dartPort);

DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t));
DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t), Dart_Port dartPort);

typedef NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *DartNativeInterfaceMap;
DN_EXTERN NSObject *DNInterfaceHostObjectWithName(char *name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</data>
<key>Headers/native_runtime.h</key>
<data>
11nRIWQMl7+5BFqADBiLFAmeBq8=
ZYgBQozNPrM6V9Evuq8apYpqxuA=
</data>
<key>Info.plist</key>
<data>
Expand Down Expand Up @@ -98,11 +98,11 @@
<dict>
<key>hash</key>
<data>
11nRIWQMl7+5BFqADBiLFAmeBq8=
ZYgBQozNPrM6V9Evuq8apYpqxuA=
</data>
<key>hash2</key>
<data>
vJX7/wTOXaOgfDR3IB07SWgm1OqfP9yPHClStItPWKk=
BzUY7yxbTuqL4GCzBqqljsdEIqwd2n4gB9BVdzIoFqA=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ DN_EXTERN void RegisterDartFinalizer(Dart_Handle h, void *callback, void *key, D

DN_EXTERN void NotifyDeallocToDart(intptr_t address, Dart_Port dartPort);

DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t));
DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t), Dart_Port dartPort);

typedef NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *DartNativeInterfaceMap;
DN_EXTERN NSObject *DNInterfaceHostObjectWithName(char *name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</data>
<key>Headers/native_runtime.h</key>
<data>
11nRIWQMl7+5BFqADBiLFAmeBq8=
ZYgBQozNPrM6V9Evuq8apYpqxuA=
</data>
<key>Info.plist</key>
<data>
Expand Down Expand Up @@ -98,11 +98,11 @@
<dict>
<key>hash</key>
<data>
11nRIWQMl7+5BFqADBiLFAmeBq8=
ZYgBQozNPrM6V9Evuq8apYpqxuA=
</data>
<key>hash2</key>
<data>
vJX7/wTOXaOgfDR3IB07SWgm1OqfP9yPHClStItPWKk=
BzUY7yxbTuqL4GCzBqqljsdEIqwd2n4gB9BVdzIoFqA=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
4 changes: 2 additions & 2 deletions dart_native/lib/src/darwin/common/callback_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class CallbackManager {

final registerDeallocCallback = nativeDylib.lookupFunction<
Void Function(
Pointer<NativeFunction<Void Function(IntPtr)>> functionPointer),
Pointer<NativeFunction<Void Function(IntPtr)>> functionPointer, Int64 dartPort),
void Function(
Pointer<NativeFunction<Void Function(IntPtr)>> functionPointer)>(
Pointer<NativeFunction<Void Function(IntPtr)>> functionPointer, int dartPort)>(
'RegisterDeallocCallback');

final interactiveCppRequests = ReceivePort()..listen(requestExecuteCallback);
Expand Down
2 changes: 1 addition & 1 deletion dart_native/lib/src/darwin/common/library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DynamicLibrary get nativeDylib {
_nativeDylib = _processDylib;
}
}
registerDeallocCallback(nativeObjectDeallocPtr.cast());
registerDeallocCallback(nativeObjectDeallocPtr.cast(), nativePort);
return _nativeDylib!;
}

Expand Down
2 changes: 1 addition & 1 deletion dart_native/macos/Classes/native_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ DN_EXTERN void RegisterDartFinalizer(Dart_Handle h, void *callback, void *key, D

DN_EXTERN void NotifyDeallocToDart(intptr_t address, Dart_Port dartPort);

DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t));
DN_EXTERN void RegisterDeallocCallback(void (*callback)(intptr_t), Dart_Port dartPort);

typedef NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *DartNativeInterfaceMap;
DN_EXTERN NSObject *DNInterfaceHostObjectWithName(char *name);
Expand Down
35 changes: 14 additions & 21 deletions dart_native_gen/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "31.0.0"
version: "22.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.0"
version: "1.7.1"
args:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -98,14 +98,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.2.0"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -140,7 +140,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
version: "1.15.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -189,7 +189,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.2.0"
ffi:
dependency: transitive
description:
Expand Down Expand Up @@ -283,21 +283,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.3.0"
mime:
dependency: transitive
description:
Expand All @@ -318,7 +311,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.0"
pedantic:
dependency: transitive
description:
Expand Down Expand Up @@ -386,7 +379,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -428,7 +421,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
version: "0.3.0"
timing:
dependency: transitive
description:
Expand All @@ -449,7 +442,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.0"
watcher:
dependency: transitive
description:
Expand All @@ -472,5 +465,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.13.0 <3.0.0"
flutter: ">=2.2.0"

0 comments on commit c01d0bb

Please sign in to comment.