Leak (Uncollected Objects); allow user to cancel long screen update
This commit is contained in:
parent
6b42d71158
commit
b54672d28d
@ -189,7 +189,7 @@ class Leak(Gramplet):
|
|||||||
"""
|
"""
|
||||||
self.parent = self.top.get_toplevel()
|
self.parent = self.top.get_toplevel()
|
||||||
progress = ProgressMeter(
|
progress = ProgressMeter(
|
||||||
_('Updating display...'), '', parent=self.parent)
|
_('Updating display...'), '', parent=self.parent, can_cancel=True)
|
||||||
self.model.clear()
|
self.model.clear()
|
||||||
self.junk = []
|
self.junk = []
|
||||||
gc.collect(2)
|
gc.collect(2)
|
||||||
@ -198,7 +198,8 @@ class Leak(Gramplet):
|
|||||||
str(len(self.junk)))
|
str(len(self.junk)))
|
||||||
progress.set_pass(_('Updating display...'), len(self.junk))
|
progress.set_pass(_('Updating display...'), len(self.junk))
|
||||||
for count in range(0, len(self.junk)):
|
for count in range(0, len(self.junk)):
|
||||||
progress.step()
|
if progress.step():
|
||||||
|
break
|
||||||
try:
|
try:
|
||||||
refs = []
|
refs = []
|
||||||
referrers = gc.get_referrers(self.junk[count])
|
referrers = gc.get_referrers(self.junk[count])
|
||||||
|
Loading…
Reference in New Issue
Block a user