File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
dart_native/lib/src/android/runtime Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,20 @@ class JObject extends Class {
19
19
20
20
//init target class
21
21
JObject (String className, {Pointer pointer, bool isInterface = false }) : super (className) {
22
- _ptr = pointer;
23
- if (_ptr == null && ! isInterface) {
22
+ if (isInterface) {
23
+ Pointer <Int64 > hashPointer = allocate ();
24
+ hashPointer.value = identityHashCode (this );
25
+ _ptr = hashPointer.cast <Void >();
26
+ return ;
27
+ }
28
+
29
+ if (pointer == null ) {
24
30
Pointer <Utf8 > classNamePtr = Utf8 .toUtf8 (super .className);
25
- _ptr = nativeCreateClass (classNamePtr, nullptr, nullptr);
31
+ pointer = nativeCreateClass (classNamePtr, nullptr, nullptr);
26
32
free (classNamePtr);
27
33
}
34
+
35
+ _ptr = pointer;
28
36
passJObjectToNative (this );
29
37
}
30
38
You can’t perform that action at this time.
0 commit comments