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

Ref counting issues with MiniObject copy #171

Closed
neilcsmith-net opened this issue Jul 18, 2019 · 1 comment
Closed

Ref counting issues with MiniObject copy #171

neilcsmith-net opened this issue Jul 18, 2019 · 1 comment
Milestone

Comments

@neilcsmith-net
Copy link
Member

As currently mapped the use of @CallerOwnsReturn on methods returning a GstMiniObject rather than a GObject may be incorrectly decrementing the refcount. MiniObject::copy is potentially one such concern. Noticed after calling Buffer::copy that the refcount is 0!

@neilcsmith-net
Copy link
Member Author

Seems to be caused where we cache an initially unowned reference where something might be pooled (eg. Buffers). Then when a caller-owns-return reference is requested later we decrement the refcount when we shouldn't. We should keep the extra ref and mark as owned.

kezhuw added a commit to kezhuw/gst1-java-core that referenced this issue Nov 6, 2019
Underlying memory of not owned native object may be freed and reused at
any time for any object.

Fixes gstreamer-java#177.
Fixes gstreamer-java#171.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant