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()
|
||||
progress = ProgressMeter(
|
||||
_('Updating display...'), '', parent=self.parent)
|
||||
_('Updating display...'), '', parent=self.parent, can_cancel=True)
|
||||
self.model.clear()
|
||||
self.junk = []
|
||||
gc.collect(2)
|
||||
@ -198,7 +198,8 @@ class Leak(Gramplet):
|
||||
str(len(self.junk)))
|
||||
progress.set_pass(_('Updating display...'), len(self.junk))
|
||||
for count in range(0, len(self.junk)):
|
||||
progress.step()
|
||||
if progress.step():
|
||||
break
|
||||
try:
|
||||
refs = []
|
||||
referrers = gc.get_referrers(self.junk[count])
|
||||
|
Loading…
Reference in New Issue
Block a user