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

Automatically clean up leaked openslide_t/openslide_cache_t refs #77

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

bgilbert
Copy link
Member

Call openslide_close()/openslide_cache_release() from a Cleaner, ensuring we don't leak a handle if OpenSlide.close()/OpenSlideCache.close() is not called. Move the handle into a separate Wrapper class; we can't implement the cleanup Runnable directly on Ref because then the Cleaner would keep the Ref alive.

The OpenSlide.close()/OpenSlideCache.close() methods are still the preferred way to release an object, since they're explicit and eager.

Call openslide_close()/openslide_cache_release() from a Cleaner, ensuring
we don't leak a handle if OpenSlide.close()/OpenSlideCache.close() is not
called.  Move the handle into a separate Wrapper class; we can't implement
the cleanup Runnable directly on Ref because then the Cleaner would keep
the Ref alive.

The OpenSlide.close()/OpenSlideCache.close() methods are still the
preferred way to release an object, since they're explicit and eager.

Signed-off-by: Benjamin Gilbert <[email protected]>
@openslide-bot
Copy link

DCO signed off ✔️

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

@bgilbert bgilbert merged commit 9183f8b into openslide:main Apr 15, 2024
5 checks passed
@bgilbert bgilbert deleted the cleaner branch April 15, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants