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

echobravo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new a430a07  GEODE-3741: Fixed double delete
a430a07 is described below

commit a430a07dd80c30ac548c83d646c2349284e6afdb
Author: Mark Hanson <mhan...@pivotal.io>
AuthorDate: Wed Oct 4 09:48:23 2017 -0700

    GEODE-3741: Fixed double delete
---
 cppcache/src/ThinClientRegion.cpp | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/cppcache/src/ThinClientRegion.cpp 
b/cppcache/src/ThinClientRegion.cpp
index da7edb3..9cabc10 100644
--- a/cppcache/src/ThinClientRegion.cpp
+++ b/cppcache/src/ThinClientRegion.cpp
@@ -3269,8 +3269,13 @@ bool ThinClientRegion::executeFunctionSH(
     threadPool->perform(worker);
     feWorkers.push_back(worker);
   }
+  LOGERROR("ThinClientRegion::executeFunctionSH worker count = %d", 
feWorkers.size());
 
-  for (const auto& worker : feWorkers) {
+  GfErrType abortError = GF_NOERR;
+
+  while ( !feWorkers.empty()) {
+    std::vector<OnRegionFunctionExecution*>::iterator iter = feWorkers.begin();
+    OnRegionFunctionExecution* worker = *iter;
     auto err = worker->getResult();
     auto currentReply = worker->getReply();
 
@@ -3328,19 +3333,22 @@ bool ThinClientRegion::executeFunctionSH(
           LOGWARN("ThinClientRegion::executeFunctionSH: Unexpected Exception");
         }
 
-        for (std::vector<OnRegionFunctionExecution*>::iterator iter2 =
-                 feWorkers.begin();
-             iter2 != feWorkers.end(); ++iter2) {
-          OnRegionFunctionExecution* worker = *iter2;
-          delete worker;
+        if(abortError == GF_NOERR) {
+          abortError = err;
         }
-        LOGDEBUG(
-            "ThinClientRegion::executeFunctionSH: Cleaned out the workers ");
-
-        GfErrTypeToException("ExecuteOnRegion:", err);
       }
     }
+    LOGERROR("ThinClientRegion::executeFunctionSH worker count = %d", 
feWorkers.size());
+
     delete worker;
+    feWorkers.erase(iter);
+    LOGERROR("ThinClientRegion::executeFunctionSH worker count = %d", 
feWorkers.size());
+
+  }
+  LOGERROR("ThinClientRegion::executeFunctionSH exited loop");
+
+  if (abortError != GF_NOERR) {
+    GfErrTypeToException("ExecuteOnRegion:", abortError);
   }
   return reExecute;
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Reply via email to