core: param loading/purging on profile connection/disconnection
- fixed default value in .*getParam.*
This commit is contained in:
parent
a0e3c43ad4
commit
fa6d27efb4
2 changed files with 42 additions and 18 deletions
|
|
@ -268,6 +268,15 @@ class SAT(service.Service):
|
|||
info(_("Disconnecting..."))
|
||||
self.profiles[profile].stopService()
|
||||
|
||||
def purgeClient(self, profile):
|
||||
"""Remove reference to a profile client and purge cache
|
||||
the garbage collector can then free the memory"""
|
||||
try:
|
||||
del self.profiles[profile]
|
||||
except KeyError:
|
||||
error(_("Trying to remove reference to a client not referenced"))
|
||||
self.memory.purgeProfile(profile)
|
||||
|
||||
def startService(self):
|
||||
info("Salut à toi ô mon frère !")
|
||||
#TODO: manage autoconnect
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ class SatXMPPClient(client.XMPPClient):
|
|||
except AttributeError:
|
||||
debug (_("No keep_alife"))
|
||||
self.host_app.bridge.disconnected(self.profile) #we send the signal to the clients
|
||||
self.host_app.purgeClient(self.profile) #and we remove references to this client
|
||||
|
||||
|
||||
class SatMessageProtocol(xmppim.MessageProtocol):
|
||||
|
|
|
|||
Loading…
Reference in a new issue