From 676fe6116711d53e5c1eaf5cecf6803cbb1d3a78 Mon Sep 17 00:00:00 2001 From: Kubo Takehiro Date: Wed, 26 Jun 2024 21:25:53 +0900 Subject: [PATCH] Fix memory leaks when Batch is explicitly closed by close() --- ChangeLog.md | 7 +++++++ src/batch.rs | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 50e3aac4..664d5160 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,11 @@ # Change Log +## 0.5.8 (2024-XX-XX) + +Fixed Issues: + +* Fix memory leaks when [`Batch`] is explicitly closed by [`close()`][`Batch::close()`]. + ## 0.5.7 (2023-01-30) New features: @@ -385,6 +391,7 @@ Incompatible changes: [chrono]: https://docs.rs/chrono/latest/chrono/index.html [`pool`]: https://www.jiubao.org/rust-oracle/oracle/pool/index.html [`Batch`]: https://www.jiubao.org/rust-oracle/oracle/struct.Batch.html +[`Batch::close()`]: https://www.jiubao.org/rust-oracle/oracle/struct.Batch.html#method.close [`Collection`]: https://www.jiubao.org/rust-oracle/oracle/sql_type/struct.Collection.html [`Collection::indices()`]: https://www.jiubao.org/rust-oracle/oracle/sql_type/struct.Collection.html#method.indices [`Collection::iter()`]: https://www.jiubao.org/rust-oracle/oracle/sql_type/struct.Collection.html#method.iter diff --git a/src/batch.rs b/src/batch.rs index aac2d503..d4b1355b 100644 --- a/src/batch.rs +++ b/src/batch.rs @@ -450,7 +450,6 @@ impl<'conn> Batch<'conn> { /// Closes the batch before the end of its lifetime. pub fn close(&mut self) -> Result<()> { chkerr!(self.conn.ctxt(), dpiStmt_close(self.handle, ptr::null(), 0)); - self.handle = ptr::null_mut(); Ok(()) }