Subject: | Object destruction suggestion |
The attached patch is just a suggestion for a change of function of:
Curses::UI::Container::delete_subwindows
The original implementation only performed deletition of -borderscr and -canvasscr throug Curses::UI::Widget::delete_subwindows on all descendant widgets.
The suggested implementation performs (in addition to the original function) deletition of all descendant widgets.
--- Container.pm.orig Tue Mar 16 14:48:25 2004
+++ Container.pm Tue Mar 16 14:48:40 2004
@@ -154,8 +154,8 @@
sub delete_subwindows()
{
my $this = shift;
- while (my ($id, $object) = each %{$this->{-id2object}}) {
- $object->delete_subwindows();
+ foreach my $id (keys %{$this->{-id2object}}) {
+ $this->delete($id);
}
$this->SUPER::delete_subwindows();
return $this;
@@ -173,8 +173,8 @@
# Draw all contained object.
foreach my $id (@{$this->{-draworder}}) {
- $this->{-id2object}->{$id}->draw(1);
- }
+ $this->{-id2object}->{$id}->draw(1);
+ }
# Update the screen unless suppressed.
doupdate() unless $no_doupdate;