J
Jerome Sui
What's a good way of detecting memory leaks in Perl ?
Does the following pattern introduce a garbage collection problem ?
package Some::ObjectObserver;
use Some::Object;
sub new {
my $self = bless {}, shift;
$self->{objects} = [Some::Object->new(sub {$self->onEvent})];
return $self;
}
sub onEvent {
}
1;
__END__
package Some::Object;
sub new {
my $self = bless {}, shift;
$self->{onEvent} = shift;
return $self;
}
1;
__END__
Does the following pattern introduce a garbage collection problem ?
package Some::ObjectObserver;
use Some::Object;
sub new {
my $self = bless {}, shift;
$self->{objects} = [Some::Object->new(sub {$self->onEvent})];
return $self;
}
sub onEvent {
}
1;
__END__
package Some::Object;
sub new {
my $self = bless {}, shift;
$self->{onEvent} = shift;
return $self;
}
1;
__END__