Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/message_window.py
    ... ... @@ -397,7 +397,7 @@ class MessageWindow(EventHelper):
    397 397
             return True # halt the delete for the moment
    
    398 398
     
    
    399 399
         def _on_window_destroy(self, win):
    
    400
    -        for ctrl in self.controls():
    
    400
    +        for ctrl in self.remove_all_controls():
    
    401 401
                 ctrl.shutdown()
    
    402 402
             self._controls.clear()
    
    403 403
             # Clean up handlers connected to the parent window, this is important since
    
    ... ... @@ -571,6 +571,7 @@ class MessageWindow(EventHelper):
    571 571
     
    
    572 572
                 fctrl = self.get_control(fjid, ctrl.account)
    
    573 573
                 bctrl = self.get_control(jid, ctrl.account)
    
    574
    +
    
    574 575
                 # keep last_message_time around unless this was our last control with
    
    575 576
                 # that jid
    
    576 577
                 if not fctrl and not bctrl and \
    
    ... ... @@ -758,6 +759,12 @@ class MessageWindow(EventHelper):
    758 759
                 for ctrl in list(jid_dict.values()):
    
    759 760
                     yield ctrl
    
    760 761
     
    
    762
    +    def remove_all_controls(self):
    
    763
    +        for _account, control_dict in self._controls.items():
    
    764
    +            for contact in list(control_dict.keys()):
    
    765
    +                yield control_dict[contact]
    
    766
    +                del control_dict[contact]
    
    767
    +
    
    761 768
         def get_nb_controls(self):
    
    762 769
             return sum(len(jid_dict) for jid_dict in self._controls.values())
    
    763 770