Skip Menu |

This queue is for tickets about the Curses-UI CPAN distribution.

Report information
The Basics
Id: 5683
Status: resolved
Priority: 0/
Queue: Curses-UI

People
Owner: Nobody in particular
Requestors: mruza [...] post.cz
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



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;
Show quoted text
> 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.
Maybe I'm kind of restrictive but I don't see the neccesity of this patch. Is it leaking memory? Is it well tested, have you tested it against a big application that does lot of createion/deletion? Have fun, Marcus
After I didn't get any feedback, I decided to close this one.