changeset 1704:292f9c2712f2

core (memory): fixed bad memory cleaning on asyncDeleteProfile
author Goffi <goffi@goffi.org>
date Mon, 30 Nov 2015 20:40:55 +0100
parents 280890460822
children 3765e10ec52f
files src/memory/memory.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/memory.py	Mon Nov 30 16:49:47 2015 +0100
+++ b/src/memory/memory.py	Mon Nov 30 20:40:55 2015 +0100
@@ -504,8 +504,15 @@
         To be used for direct calls only (not through the bridge).
         @return: a Deferred instance
         """
-        self.auth_sessions.profileDelUnique(name)
-        return self.params.asyncDeleteProfile(name, force)
+        def cleanMemory(dummy):
+            self.auth_sessions.profileDelUnique(name)
+            try:
+                del self._entities_cache[name]
+            except KeyError:
+                pass
+        d = self.params.asyncDeleteProfile(name, force)
+        d.addCallback(cleanMemory)
+        return d
 
     ## History ##