rdf4j
rdf4j copied to clipboard
GH-3539 use a cleaner and shutdown hook instead of finalize()
GitHub issue resolved: #3539
Briefly describe the changes proposed in this PR:
Use a Cleaner and shutdown hook to make sure unused resources are removed cleanly and efficiently without spooky behaviour.
PR Author Checklist (see the contributor guidelines for more details):
- [x] my pull request is self-contained
- [ ] I've added tests for the changes I made
- [x] I've applied code formatting (you can use
mvn process-resourcesto format from the command line) - [x] I've squashed my commits where necessary
- [x] every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change
@kenwenzel please have a look at this and verify that I got the intention right.
Historically, I have been bitten by finalizers to often and I am highly suspicious of them.
This implementation is buggy and does not work as intended. I register the store reference which thus never is phantom reachable. Fixed in #3542 let's merge that first and then redo this one.
Marked this as stale to signal that the PR hasn't been active for a while and that we should consider closing it.