Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart_CObject_kNativePointer finalizer is never executed #48379

Open
knopp opened this issue Feb 11, 2022 · 3 comments
Open

Dart_CObject_kNativePointer finalizer is never executed #48379

knopp opened this issue Feb 11, 2022 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@knopp
Copy link
Contributor

knopp commented Feb 11, 2022

I send a native pointer DartCObject through a native port, but for some reason on dart side it is received as integer with value of pointer address and the finalizer specified in the structure is never executed.

@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Feb 11, 2022
@mraleph
Copy link
Member

mraleph commented Feb 13, 2022

This finalizer is only going to be invoked if message is not properly delivered.

Please don't use this type - it is not doing what you think it is doing. It was introduced for some internal usage in dart:io and has no relationship to dart:ffi Pointer.

@aam @dcharkes We should update documentation in the header file to reflect semantics of this type. It is not the first time when people are confused about it.

@knopp
Copy link
Contributor Author

knopp commented Feb 13, 2022

Thanks for the reply! I used Dart_WeakPersistentHandle instead, works as expected.

@aam
Copy link
Contributor

aam commented Feb 13, 2022

copybara-service bot pushed a commit that referenced this issue Feb 21, 2022
Addresses #48379

TEST=not needed, only documentation update

Change-Id: I2d82c6533ef64cd9ff62428e20a2e66013a35e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233642
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

4 participants