Skip to content

Commit

Permalink
* Fix memory leak that occurs with "org.bytedeco.javacpp.nopointergc…
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed May 5, 2020
1 parent 6a854c7 commit 6aee52e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix memory leak that occurs with "org.bytedeco.javacpp.nopointergc" ([issue bytedeco/javacpp-presets#878](https://github.com/bytedeco/javacpp-presets/issues/878))
* Take into account `platform.library.path` when extracting executables and their libraries on `Loader.load()` ([issue bytedeco/javacv#1410](https://github.com/bytedeco/javacv/issues/1410))
* Move init code for `Loader.getPlatform()` to `Detector` to avoid warning messages ([issue #393](https://github.com/bytedeco/javacpp/issues/393))
* Add `HyperslabIndex` class with `offsets`, `strides`, `counts`, and `blocks` parameters ([pull #392](https://github.com/bytedeco/javacpp/pull/392))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bytedeco/javacpp/Pointer.java
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ public void deallocate() {
* @param deallocate if true, deallocates, else does not, but disables garbage collection
*/
public void deallocate(boolean deallocate) {
DeallocatorReference r = (DeallocatorReference)deallocator;
if (deallocate && deallocator != null) {
if (logger.isDebugEnabled()) {
logger.debug("Deallocating " + this);
Expand All @@ -727,7 +728,6 @@ public void deallocate(boolean deallocate) {
address = 0;
}
if (!deallocate || referenceQueue == null) {
DeallocatorReference r = (DeallocatorReference)deallocator;
if (r != null) {
// remove from queue without calling the deallocator
Deallocator d = r.deallocator;
Expand Down

0 comments on commit 6aee52e

Please sign in to comment.