Add more debugging and make sure we don't fall into the trap of iterating over a list we're modifying
This commit is contained in:
parent
7b24823fd6
commit
24b6082155
|
@ -133,6 +133,7 @@ class Notebook(Container, gtk.Notebook):
|
||||||
|
|
||||||
def wrapcloseterm(self, widget):
|
def wrapcloseterm(self, widget):
|
||||||
"""A child terminal has closed"""
|
"""A child terminal has closed"""
|
||||||
|
dbg('Notebook::wrapcloseterm: called on %s' % widget)
|
||||||
if self.closeterm(widget):
|
if self.closeterm(widget):
|
||||||
dbg('Notebook::wrapcloseterm: closeterm succeeded')
|
dbg('Notebook::wrapcloseterm: closeterm succeeded')
|
||||||
if self.get_n_pages() == 1:
|
if self.get_n_pages() == 1:
|
||||||
|
@ -164,7 +165,7 @@ class Notebook(Container, gtk.Notebook):
|
||||||
break
|
break
|
||||||
|
|
||||||
if not tabnum:
|
if not tabnum:
|
||||||
err('TabLabel::closetab: %s not in %s' % (label, nb))
|
err('TabLabel::closetab: %s not in %s. Bailing.' % (label, nb))
|
||||||
return
|
return
|
||||||
|
|
||||||
maker = Factory()
|
maker = Factory()
|
||||||
|
@ -196,8 +197,10 @@ class Notebook(Container, gtk.Notebook):
|
||||||
elif maker.isinstance(descendant, 'Terminal'):
|
elif maker.isinstance(descendant, 'Terminal'):
|
||||||
objects.append(descendant)
|
objects.append(descendant)
|
||||||
|
|
||||||
for descendant in objects:
|
while len(objects) > 0:
|
||||||
|
descendant = objects.pop()
|
||||||
descendant.close()
|
descendant.close()
|
||||||
|
# FIXME: Is this mainloop iterations stuff necessary?
|
||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue