You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/07/30 04:09:58 UTC

[iotdb] branch iotdb-1282 created (now bf1347c)

This is an automated email from the ASF dual-hosted git repository.

rong pushed a change to branch iotdb-1282
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at bf1347c  [IOTDB-1282] fix C++ class SessionDataSet mem-leak

This branch includes the following new commits:

     new bf1347c  [IOTDB-1282] fix C++ class SessionDataSet mem-leak

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: [IOTDB-1282] fix C++ class SessionDataSet mem-leak

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch iotdb-1282
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit bf1347c652251a58ac518dac73905787e5d0423c
Author: haiyi.zb <ha...@alibaba-inc.com>
AuthorDate: Wed Apr 7 12:05:12 2021 +0759

    [IOTDB-1282] fix C++ class SessionDataSet mem-leak
    
    (cherry picked from commit cea339de0fabe5a8988a80754e4efe9650bd71c8)
---
 client-cpp/src/main/Session.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/client-cpp/src/main/Session.h b/client-cpp/src/main/Session.h
index 62995a4..7e1a8c3 100644
--- a/client-cpp/src/main/Session.h
+++ b/client-cpp/src/main/Session.h
@@ -523,7 +523,7 @@ private:
     std::vector<std::unique_ptr<MyStringBuffer>> valueBuffers;
     std::vector<std::unique_ptr<MyStringBuffer>> bitmapBuffers;
     RowRecord rowRecord;
-    char* currentBitmap; // used to cache the current bitmap for every column
+    char* currentBitmap = NULL; // used to cache the current bitmap for every column
     static const int flag = 0x80; // used to do `or` operation with bitmap to judge whether the value is null
 
 public:
@@ -554,6 +554,13 @@ public:
         this->tsQueryDataSet = queryDataSet;
     }
 
+    ~SessionDataSet() {
+        if (currentBitmap != NULL) {
+            delete[] currentBitmap;
+            currentBitmap = NULL;
+        }
+    }
+
     int getBatchSize();
     void setBatchSize(int batchSize);
     std::vector<std::string> getColumnNames();