mirror of
https://github.com/gryf/tabbedalt.git
synced 2026-08-20 18:11:48 +02:00
Remove referencees for variables to free memory in copy_properties function
This commit is contained in:
@@ -415,8 +415,8 @@ sub copy_properties {
|
|||||||
my $current = delete $self->{current_properties};
|
my $current = delete $self->{current_properties};
|
||||||
|
|
||||||
# pass 1: copy over properties different or nonexisting
|
# pass 1: copy over properties different or nonexisting
|
||||||
for my $atom ($tab->XListProperties ($tab->parent)) {
|
for my $atom ($tab->XListProperties($tab->parent)) {
|
||||||
my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom);
|
my ($type, $format, $items) = $self->XGetWindowProperty($tab->parent, $atom);
|
||||||
|
|
||||||
# fix up size hints
|
# fix up size hints
|
||||||
if ($atom == $wm_normal_hints) {
|
if ($atom == $wm_normal_hints) {
|
||||||
@@ -428,22 +428,29 @@ sub copy_properties {
|
|||||||
$hints[$_] += $self->{tabheight} for (4, 6, 16);
|
$hints[$_] += $self->{tabheight} for (4, 6, 16);
|
||||||
|
|
||||||
$items = pack "l!*", @hints;
|
$items = pack "l!*", @hints;
|
||||||
|
undef @hints;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cur = delete $current->{$atom};
|
my $cur = delete $current->{$atom};
|
||||||
|
|
||||||
# update if changed, we assume empty items and zero type and format will not happen
|
# update if changed, we assume empty items and zero type and format will not happen
|
||||||
$self->XChangeProperty ($self->parent, $atom, $type, $format, $items)
|
$self->XChangeProperty($self->parent, $atom, $type, $format, $items)
|
||||||
if $cur->[0] != $type or $cur->[1] != $format or $cur->[2] ne $items;
|
if $cur->[0] != $type or $cur->[1] != $format or $cur->[2] ne $items;
|
||||||
|
|
||||||
$self->{current_properties}{$atom} = [$type, $format, $items];
|
$self->{current_properties}{$atom} = [$type, $format, $items];
|
||||||
|
|
||||||
undef $type;
|
undef $type;
|
||||||
undef $format;
|
undef $format;
|
||||||
undef $items;
|
undef $items;
|
||||||
|
undef $atom;
|
||||||
|
undef $cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
# pass 2, delete all extraneous properties
|
# pass 2, delete all extraneous properties
|
||||||
$self->XDeleteProperty ($self->parent, $_) for keys %$current;
|
$self->XDeleteProperty ($self->parent, $_) for keys %$current;
|
||||||
|
|
||||||
|
undef $current;
|
||||||
|
undef $wm_normal_hints;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub make_current {
|
sub make_current {
|
||||||
|
|||||||
Reference in New Issue
Block a user