Destroying purple.core in nullclient.py
authorAnderson Briglia <anderson.briglia@openbossa.org>
Thu, 18 Jun 2009 15:28:52 +0000 (11:28 -0400)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Thu, 18 Jun 2009 15:28:52 +0000 (11:28 -0400)
- Nullclient demo was not deallocating libpurple resources properly.
  This patch adds a call to purple.core.destroy() method which can
  handle this.

Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>

nullclient.py

index 2dbbda0..8386d7c 100644 (file)
@@ -64,5 +64,9 @@ if __name__ == '__main__':
     account.set_enabled(True)
 
     while True:
     account.set_enabled(True)
 
     while True:
-        core.iterate_main_loop()
-        time.sleep(0.01)
+        try:
+            core.iterate_main_loop()
+            time.sleep(0.01)
+        except KeyboardInterrupt:
+            core.destroy()
+            break