Ignore:
Timestamp:
10/08/13 12:20:06 (7 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed errors in Scheme/SignalManager shutdown/delete process.

(fixes #1331)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/scheme/widgetsscheme.py

    r11659 r11722  
    5252 
    5353        self.signal_manager = WidgetsSignalManager(self) 
    54         self.widget_manager = WidgetManager(self) 
     54        self.widget_manager = WidgetManager() 
    5555        self.widget_manager.set_scheme(self) 
    5656 
     
    106106    InputUpdate, BlockingUpdate, ProcessingUpdate = 1, 2, 4 
    107107 
    108     def __init__(self, parent): 
     108    def __init__(self, parent=None): 
    109109        QObject.__init__(self, parent) 
    110110        self.__scheme = None 
     
    295295 
    296296    def eventFilter(self, receiver, event): 
    297         if receiver is self.__scheme and event.type() == QEvent.Close: 
     297        if event.type() == QEvent.Close and receiver is self.__scheme: 
    298298            self.signal_manager().stop() 
    299299 
     
    709709 
    710710    def eventFilter(self, receiver, event): 
    711         if receiver is self.scheme() and event.type() == QEvent.DeferredDelete: 
    712             if self.runtime_state() == SignalManager.Processing: 
     711        if event.type() == QEvent.DeferredDelete and receiver is self.scheme(): 
     712            try: 
     713                state = self.runtime_state() 
     714            except AttributeError: 
     715                # If the scheme (which is a parent of this object) is 
     716                # already being deleted the SignalManager can also be in 
     717                # the process of destruction (noticeable by its __dict__ 
     718                # being empty). There is nothing really to do in this 
     719                # case. 
     720                state = None 
     721 
     722            if state == SignalManager.Processing: 
    713723                log.info("Deferring a 'DeferredDelete' event for the Scheme " 
    714724                         "instance until SignalManager exits the current " 
Note: See TracChangeset for help on using the changeset viewer.