File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ the Event loop.
3737package PDL::Graphics::TriD::ButtonControl ;
3838use strict;
3939use warnings;
40+ use Scalar::Util qw( weaken) ;
4041use fields qw/ Win W H SC/ ;
4142
4243$PDL::Graphics::TriD::verbose //= 0;
@@ -45,7 +46,7 @@ sub new {
4546 my ($class ,$win ) = @_ ;
4647
4748 my $self = fields::new($class );
48- $self -> {Win } = $win ;
49+ weaken( $self -> {Win } = $win ) ;
4950
5051 $self ;
5152}
Original file line number Diff line number Diff line change @@ -181,14 +181,16 @@ sub set_material {
181181package # hide from PAUSE
182182 PDL::Graphics::TriD::EventHandler;
183183use fields qw/ X Y Buttons VP/ ;
184+ use Scalar::Util qw( weaken) ;
185+
184186sub new {
185187 my $class = shift ;
186188 my $vp = shift ;
187189 my $self = fields::new($class );
188190 $self -> {X } = -1;
189191 $self -> {Y } = -1;
190192 $self -> {Buttons } = [];
191- $self -> {VP } = $vp ;
193+ weaken( $self -> {VP } = $vp ) ;
192194 $self ;
193195}
194196sub event {
You can’t perform that action at this time.
0 commit comments