Skip to content

Commit

Permalink
canvas/widgetsscheme: Remove use of QObject.destroyed for logging
Browse files Browse the repository at this point in the history
Use weakref.finalize instead.
  • Loading branch information
ales-erjavec committed Dec 6, 2018
1 parent 6d21e6c commit c132f62
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Orange/canvas/scheme/widgetsscheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import itertools
from collections import namedtuple, deque
from urllib.parse import urlencode
from weakref import finalize
from typing import List, Tuple
import sip

Expand Down Expand Up @@ -513,11 +514,9 @@ def _delete_widget(self, widget):
widget.deleteLater()
name = "{} '{}'".format(type(widget).__name__, widget.captionTitle)
if log.isEnabledFor(logging.DEBUG):
widget.destroyed.connect(
lambda: log.debug("Destroyed: %s", name))
widget.__marker = QObject()
widget.__marker.destroyed.connect(
lambda: log.debug("Destroyed namespace: %s", name))
finalize(
widget, log.debug, "Destroyed namespace: %s", name
)
del self.__widget_processing_state[widget]

def create_widget_instance(self, node):
Expand Down

0 comments on commit c132f62

Please sign in to comment.