diff --git a/src/common/connection.py b/src/common/connection.py
index bc5451a359fc91295145e75083a0174526b5d327..a8571564286a9b2188b54ddb2488f11725718dfd 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -719,11 +719,14 @@ class Connection(CommonConnection, ConnectionHandlers):
             self._nec_agent_info_received)
     # END __init__
 
-    def __del__(self):
+    def cleanup(self):
+        ConnectionHandlers.cleanup(self)
         gajim.ged.remove_event_handler('privacy-list-received', ged.CORE,
             self._nec_privacy_list_received)
         gajim.ged.remove_event_handler('agent-info-error-received', ged.CORE,
             self._nec_agent_info_error_received)
+        gajim.ged.remove_event_handler('agent-info-received', ged.CORE,
+            self._nec_agent_info_received)
 
     def get_config_values_or_default(self):
         if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'):
diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index b1021cdbcb66f3d86ca304c4057049a145b8a462..169b5c7a0dfa07e9efc469e3ebba08a5472695ee 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -766,6 +766,16 @@ class ConnectionHandlersBase:
         gajim.ged.register_event_handler('decrypted-message-received', ged.CORE,
             self._nec_decrypted_message_received)
 
+    def cleanup(self):
+        gajim.ged.remove_event_handler('iq-error-received', ged.CORE,
+            self._nec_iq_error_received)
+        gajim.ged.remove_event_handler('presence-received', ged.CORE,
+            self._nec_presence_received)
+        gajim.ged.remove_event_handler('message-received', ged.CORE,
+            self._nec_message_received)
+        gajim.ged.remove_event_handler('decrypted-message-received', ged.CORE,
+            self._nec_decrypted_message_received)
+
     def _nec_iq_error_received(self, obj):
         if obj.conn.name != self.name:
             return
@@ -1265,6 +1275,48 @@ ConnectionJingle, ConnectionIBBytestream):
         gajim.ged.register_event_handler('agent-removed', ged.CORE,
             self._nec_agent_removed)
 
+    def cleanup(self):
+        ConnectionHandlersBase.cleanup(self)
+        ConnectionCaps.cleanup(self)
+        ConnectionArchive.cleanup(self)
+        ConnectionPubSub.cleanup(self)
+        gajim.ged.remove_event_handler('http-auth-received', ged.CORE,
+            self._nec_http_auth_received)
+        gajim.ged.remove_event_handler('version-request-received', ged.CORE,
+            self._nec_version_request_received)
+        gajim.ged.remove_event_handler('last-request-received', ged.CORE,
+            self._nec_last_request_received)
+        gajim.ged.remove_event_handler('time-request-received', ged.CORE,
+            self._nec_time_request_received)
+        gajim.ged.remove_event_handler('time-revised-request-received',
+            ged.CORE, self._nec_time_revised_request_received)
+        gajim.ged.remove_event_handler('roster-set-received',
+            ged.CORE, self._nec_roster_set_received)
+        gajim.ged.remove_event_handler('private-storage-bookmarks-received',
+            ged.CORE, self._nec_private_storate_bookmarks_received)
+        gajim.ged.remove_event_handler('private-storage-rosternotes-received',
+            ged.CORE, self._nec_private_storate_rosternotes_received)
+        gajim.ged.remove_event_handler('roster-received', ged.CORE,
+            self._nec_roster_received)
+        gajim.ged.remove_event_handler('iq-error-received', ged.CORE,
+            self._nec_iq_error_received)
+        gajim.ged.remove_event_handler('gmail-new-mail-received', ged.CORE,
+            self._nec_gmail_new_mail_received)
+        gajim.ged.remove_event_handler('ping-received', ged.CORE,
+            self._nec_ping_received)
+        gajim.ged.remove_event_handler('subscribe-presence-received',
+            ged.CORE, self._nec_subscribe_presence_received)
+        gajim.ged.remove_event_handler('subscribed-presence-received',
+            ged.CORE, self._nec_subscribed_presence_received)
+        gajim.ged.remove_event_handler('subscribed-presence-received',
+            ged.POSTGUI, self._nec_subscribed_presence_received_end)
+        gajim.ged.remove_event_handler('unsubscribed-presence-received',
+            ged.CORE, self._nec_unsubscribed_presence_received)
+        gajim.ged.remove_event_handler('unsubscribed-presence-received',
+            ged.POSTGUI, self._nec_unsubscribed_presence_received_end)
+        gajim.ged.remove_event_handler('agent-removed', ged.CORE,
+            self._nec_agent_removed)
+
     def build_http_auth_answer(self, iq_obj, answer):
         if not self.connection or self.connected < 2:
             return
diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py
index ee254841db1c058a8f143480992955e22256a571..32936462b084369ae76333c3277da341cf2b3d2e 100644
--- a/src/common/message_archiving.py
+++ b/src/common/message_archiving.py
@@ -46,6 +46,11 @@ class ConnectionArchive:
             'archiving-preferences-changed-received', ged.CORE,
             self._nec_archiving_changed_received)
 
+    def cleanup(self):
+        gajim.ged.remove_event_handler(
+            'archiving-preferences-changed-received', ged.CORE,
+            self._nec_archiving_changed_received)
+
     def request_message_archiving_preferences(self):
         iq_ = common.xmpp.Iq('get')
         iq_.setTag('pref', namespace=common.xmpp.NS_ARCHIVE)
diff --git a/src/common/protocol/bytestream.py b/src/common/protocol/bytestream.py
index c85702ac02e91e9d4a32203ce06e30180d8faa5c..ab71f91f95a1ccbf47c5e8ad107299a80ddd8f74 100644
--- a/src/common/protocol/bytestream.py
+++ b/src/common/protocol/bytestream.py
@@ -85,6 +85,10 @@ class ConnectionBytestream:
         gajim.ged.register_event_handler('file-request-received', ged.GUI1,
             self._nec_file_request_received)
 
+    def cleanup(self):
+        gajim.ged.remove_event_handler('file-request-received', ged.GUI1,
+            self._nec_file_request_received)
+
     def _ft_get_our_jid(self):
         our_jid = gajim.get_jid_from_account(self.name)
         resource = self.server_resource
diff --git a/src/common/protocol/caps.py b/src/common/protocol/caps.py
index 78880bf87b3d42610dee35aed523512bd4ef1758..79c71da4883528c084d31d05f16ae5189e937ec3 100644
--- a/src/common/protocol/caps.py
+++ b/src/common/protocol/caps.py
@@ -46,6 +46,12 @@ class ConnectionCaps(object):
         gajim.ged.register_event_handler('agent-info-received', ged.GUI1,
             self._nec_agent_info_received_caps)
 
+    def cleanup(self):
+        gajim.ged.remove_event_handler('caps-presence-received', ged.GUI1,
+            self._nec_caps_presence_received)
+        gajim.ged.remove_event_handler('agent-info-received', ged.GUI1,
+            self._nec_agent_info_received_caps)
+
     def caps_change_account_name(self, new_name):
         self._account = new_name
 
diff --git a/src/common/pubsub.py b/src/common/pubsub.py
index d0536e40d51e21711d67db4b71ecd20ba9cb3b5e..50a69928bbbdb7f98bd963435aa8ef54d3d49161 100644
--- a/src/common/pubsub.py
+++ b/src/common/pubsub.py
@@ -37,6 +37,10 @@ class ConnectionPubSub:
         gajim.ged.register_event_handler('pubsub-bookmarks-received',
             ged.CORE, self._nec_pubsub_bookmarks_received)
 
+    def cleanup(self):
+        gajim.ged.remove_event_handler('pubsub-bookmarks-received',
+            ged.CORE, self._nec_pubsub_bookmarks_received)
+
     def send_pb_subscription_query(self, jid, cb, *args, **kwargs):
         if not self.connection or self.connected < 2:
             return
@@ -212,4 +216,4 @@ class ConnectionPubSub:
         id_ = self.connection.getAnID()
         query.setID(id_)
         self.awaiting_answers[id_] = (connection_handlers.PEP_CONFIG,)
-        self.connection.send(query)
\ No newline at end of file
+        self.connection.send(query)
diff --git a/src/config.py b/src/config.py
index 6ea18c14c8a732dc8733ebf8ca3fb7fa1d9b8e3a..45468b185ae376121421562abc836ce81075811d 100644
--- a/src/config.py
+++ b/src/config.py
@@ -3005,6 +3005,7 @@ class RemoveAccountWindow:
         gajim.interface.roster.close_all(self.account, force=True)
         if self.account in gajim.connections:
             gajim.connections[self.account].disconnect(on_purpose=True)
+            gajim.connections[self.account].cleanup()
             del gajim.connections[self.account]
         gajim.logger.remove_roster(gajim.get_jid_from_account(self.account))
         gajim.config.del_per('accounts', self.account)