Skip to content

Commit

Permalink
Fix user attachment bytes not beeing freed. (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP authored Mar 6, 2024
1 parent d20dab3 commit 50f0213
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zenoh-jni/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ pub(crate) fn on_query(
_ = env
.delete_local_ref(payload)
.map_err(|err| log::error!("Error deleting local ref: {}", err));
_ = env
.delete_local_ref(attachment_bytes)
.map_err(|err| log::error!("Error deleting local ref: {}", err));
result
}

Expand Down
3 changes: 3 additions & 0 deletions zenoh-jni/src/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ fn on_reply_success(
_ = env
.delete_local_ref(byte_array)
.map_err(|err| log::debug!("Error deleting local ref: {}", err));
_ = env
.delete_local_ref(attachment_bytes)
.map_err(|err| log::debug!("Error deleting local ref: {}", err));
result
}

Expand Down
3 changes: 3 additions & 0 deletions zenoh-jni/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ pub(crate) unsafe fn declare_subscriber(
_ = env
.delete_local_ref(byte_array)
.map_err(|err| log::debug!("Error deleting local ref: {}", err));
_ = env
.delete_local_ref(attachment_bytes)
.map_err(|err| log::debug!("Error deleting local ref: {}", err));
})
.reliability(reliability)
.res();
Expand Down

0 comments on commit 50f0213

Please sign in to comment.