You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DelayedRunnable() instance will be deleted by Python GC, before java use it.
This is why we can have than kind of weirdness:
I/python (25412): !! create_proxy_instance() on 1548769344 <__main__.DelayedRunnable object at 0x5c505840>
...
I/python (25412): !! invoke0() from (1548769344, 1548769344) ('', 'system', 'dock', 'multi')
I/python (25412): Exception AttributeError: "'tuple' object has no attribute 'invoke'" in 'jnius.jnius.invoke0' ignored
We need to keep a reference of the DelayedRunnable until the java proxy is really deleted. Keeping a reference is not an issue, detecting when to release it is the issue.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1362784-link-python-gc-to-java-gc-for-pythonjavaclass?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github).
The text was updated successfully, but these errors were encountered:
If you find this page, hold a Python reference to whatever Java object is getting destroyed as a workaround. The bug -seems- very difficult, but is easy to get around.
Take a look at this snippet:
The DelayedRunnable() instance will be deleted by Python GC, before java use it.
This is why we can have than kind of weirdness:
We need to keep a reference of the DelayedRunnable until the java proxy is really deleted. Keeping a reference is not an issue, detecting when to release it is the issue.
Maybe http://docs.oracle.com/javase/6/docs/api/java/lang/ref/PhantomReference.html could help us, but i'm not sure about how to use it.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1362784-link-python-gc-to-java-gc-for-pythonjavaclass?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F77133&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: