Fixed a memory leak caused by a proliferation in phantomjs processes.
Sapan Bhatia [Wed, 30 Apr 2014 16:50:12 +0000 (12:50 -0400)]
fofum.py

index 18489ef..762a64e 100755 (executable)
--- a/fofum.py
+++ b/fofum.py
@@ -98,6 +98,12 @@ class Fofum:
                 elif (status<0):
                     break
         # Returns when connection breaks. Caller needs to resubscribe, relisten
+        try:
+            conn.close()
+        except Exception,e:
+            print "Could not terminate phantomjs. This may cause a memory leak."
+            print str(e)
+
         return    
 
     # This method creates/looks up an event, subscribes to it, listens and reconnects if necessary.