Skip to content

Commit

Permalink
* Add public getters for the address fields of `Pointer.NativeDeallo…
Browse files Browse the repository at this point in the history
…cator` (discussion bytedeco/javacpp-presets#1160)
  • Loading branch information
saudet committed Mar 23, 2022
1 parent 587ed7a commit 730ae11
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@

* Add public getters for the address fields of `Pointer.NativeDeallocator` ([discussion bytedeco/javacpp-presets#1160](https://github.com/bytedeco/javacpp-presets/discussions/1160))
* Add support for `std::function` basic container instances with corresponding `FunctionPointer`
* Fix `Builder` parsing of command line options for platform properties ([issue #564](https://github.com/bytedeco/javacpp/issues/564))
* Use thread local in `Generator` to detach automatically native threads on exit for Windows as well ([pull #562](https://github.com/bytedeco/javacpp/pull/562))
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/bytedeco/javacpp/Pointer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2021 Samuel Audet
* Copyright (C) 2011-2022 Samuel Audet
*
* Licensed either under the Apache License, Version 2.0, or (at your option)
* under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -223,6 +223,9 @@ protected static class NativeDeallocator extends DeallocatorReference {
private long ownerAddress;
private long deallocatorAddress;

public long ownerAddress() { return ownerAddress; }
public long deallocatorAddress() { return deallocatorAddress; }

@Override public void deallocate() {
if (ownerAddress != 0 && deallocatorAddress != 0) {
deallocate(ownerAddress, deallocatorAddress);
Expand Down

0 comments on commit 730ae11

Please sign in to comment.