Repository navigation
Conversation
Preserve the handle before zeroing the Java field so ServiceActionDestroy receives the allocated native Action. This retains idempotent destroy while preventing a per-action native leak.
|
The maintainers of this repo haven't accepted a patch in over a decade. I doubt this situation will change, unfortunately. |
Author
That's a bummer. Any idea why is that? |
|
I suppose this a classical source-drop development model. The software if developed in a closed fashion and every now and then we get a current source drop. Kinda like Android. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Action.destroy()currently setsiHandleto zero before passing it toServiceActionDestroy. The JNI bridge forwards that zero, so the allocated native action and its parameters are not released. Preserve the original handle under the existing lock and pass it to native destruction after makingdestroy()idempotent.Reproduction and validation
b86dab7ff82cd972ef83cf27aab667e821242440.javac --release 8) and Android NDK 30.0.16248370.Actioncreate/destroy cycles with one input and one output parameter increasedDebug.getNativeHeapAllocatedSize()by 4,320,336 bytes before library shutdown (78 ms).destroy()twice on each of 10,000 patched actions completed without a crash or accumulating native heap.GetProtocolInfoand its initial GENA sink event matched. No playback or volume action was sent.OpenHome/Net/Bindings/Java/org/openhome/net/core/Action.java.This PR is a draft while broader proxy lifecycle and release checks continue.