Mercurial > libervia-backend
comparison src/memory/memory.py @ 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 | 5a93f13c1e76 |
children | 5632c5350296 |
comparison
equal
deleted
inserted
replaced
1703:280890460822 | 1704:292f9c2712f2 |
---|---|
502 @param name: Name of the profile | 502 @param name: Name of the profile |
503 @param force: force the deletion even if the profile is connected. | 503 @param force: force the deletion even if the profile is connected. |
504 To be used for direct calls only (not through the bridge). | 504 To be used for direct calls only (not through the bridge). |
505 @return: a Deferred instance | 505 @return: a Deferred instance |
506 """ | 506 """ |
507 self.auth_sessions.profileDelUnique(name) | 507 def cleanMemory(dummy): |
508 return self.params.asyncDeleteProfile(name, force) | 508 self.auth_sessions.profileDelUnique(name) |
509 try: | |
510 del self._entities_cache[name] | |
511 except KeyError: | |
512 pass | |
513 d = self.params.asyncDeleteProfile(name, force) | |
514 d.addCallback(cleanMemory) | |
515 return d | |
509 | 516 |
510 ## History ## | 517 ## History ## |
511 | 518 |
512 def addToHistory(self, from_jid, to_jid, message, type_='chat', extra=None, timestamp=None, profile=C.PROF_KEY_NONE): | 519 def addToHistory(self, from_jid, to_jid, message, type_='chat', extra=None, timestamp=None, profile=C.PROF_KEY_NONE): |
513 assert profile != C.PROF_KEY_NONE | 520 assert profile != C.PROF_KEY_NONE |