Skip to content

Conversation

@ktoso
Copy link
Collaborator

@ktoso ktoso commented May 5, 2025

This isn't really a solution but just showcases the issue.

We cannot just return a newly created object without keeping the ref alive as we'll get a null on the java side otherwise.

The solution will be managing refs and checking if we escaped them or not proably...

ktoso added 3 commits May 5, 2025 13:06
We must reinvent how we promote values to global refs etc. Without the
promotion we get a null. We need to manage the retains automatically as
we return from a downcall in any wrapped java wrapper class etc...

deinit {
self.forget()
// self.forget()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixme, not real solution ofc.

@ktoso ktoso marked this pull request as draft May 5, 2025 04:20
@colemancda
Copy link
Contributor

I believe this is related to the behavior I was seeing #272

@ktoso ktoso added the jni label Jul 14, 2025
@ktoso ktoso removed the jni label Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants