From 1870d2b4082228e07ea6a856276c7c6f9719ad20 Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Mon, 20 Aug 2018 11:17:01 +0200
Subject: [PATCH] [pool] Reintroduce the fact than in the destructor we should
 go at the beginning of the map.

---
 src/dgraph/pool.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dgraph/pool.cpp b/src/dgraph/pool.cpp
index 8b4c94a..d1c4422 100644
--- a/src/dgraph/pool.cpp
+++ b/src/dgraph/pool.cpp
@@ -60,7 +60,9 @@ PoolStorage::
   dgDEBUGIN(15);
 
   for( Entities::iterator iter=entityMap.begin (); iter!=entityMap.end ();
-       iter++)
+       // Here, this is normal that the next iteration is at the beginning
+       // of the map as deregisterEntity remove the element iter from the map.
+       iter=entityMap.begin())
     {
       dgDEBUG(15) << "Delete \""
 		   << (iter->first) <<"\""<<std::endl;
-- 
GitLab