You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/08/06 05:23:08 UTC

[iotdb] branch master updated: [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists (#3692)

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

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new a2c446a  [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists (#3692)
a2c446a is described below

commit a2c446afecb7e23c163150344edc70014c6ef592
Author: Steve Yurong Su (宇荣) <ro...@apache.org>
AuthorDate: Fri Aug 6 00:22:46 2021 -0500

    [ISSUE-3690] Memory leaks on the server when cpp client invokes checkTimeseriesExists (#3692)
---
 client-cpp/src/main/Session.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/client-cpp/src/main/Session.cpp b/client-cpp/src/main/Session.cpp
index 59a7099..6d639b7 100644
--- a/client-cpp/src/main/Session.cpp
+++ b/client-cpp/src/main/Session.cpp
@@ -1020,8 +1020,10 @@ void Session::createMultiTimeseries(vector <string> paths, vector <TSDataType::T
 
 bool Session::checkTimeseriesExists(string path) {
     try {
-        string sql = "SHOW TIMESERIES " + path;
-        return executeQueryStatement(sql)->hasNext();
+        std::unique_ptr <SessionDataSet> dataset = executeQueryStatement("SHOW TIMESERIES " + path);
+        bool isExisted = dataset->hasNext();
+        dataset->closeOperationHandle();
+        return isExisted;
     }
     catch (exception e) {
         throw IoTDBConnectionException(e.what());