projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d9ea7c
)
import Scalar::Util to test weaken references of perl objects
author
Wolfram Schneider
<wosch@indexdata.dk>
Wed, 14 Apr 2010 09:35:38 +0000
(09:35 +0000)
committer
Wolfram Schneider
<wosch@indexdata.dk>
Wed, 14 Apr 2010 09:35:38 +0000
(09:35 +0000)
lib/ZOOM/IRSpy/Node.pm
patch
|
blob
|
history
lib/ZOOM/IRSpy/Record.pm
patch
|
blob
|
history
lib/ZOOM/IRSpy/Stats.pm
patch
|
blob
|
history
lib/ZOOM/IRSpy/Task.pm
patch
|
blob
|
history
lib/ZOOM/IRSpy/Test.pm
patch
|
blob
|
history
lib/ZOOM/IRSpy/Utils.pm
patch
|
blob
|
history
diff --git
a/lib/ZOOM/IRSpy/Node.pm
b/lib/ZOOM/IRSpy/Node.pm
index
f912b94
..
9d2f5c7
100644
(file)
--- a/
lib/ZOOM/IRSpy/Node.pm
+++ b/
lib/ZOOM/IRSpy/Node.pm
@@
-6,6
+6,7
@@
use 5.008;
use strict;
use warnings;
use strict;
use warnings;
+use Scalar::Util;
=head1 NAME
=head1 NAME
@@
-57,13
+58,15
@@
changed.
sub new {
my $class = shift();
my($name, @subnodes) = @_;
sub new {
my $class = shift();
my($name, @subnodes) = @_;
- return bless {
+ my $this = bless {
name => $name,
subnodes => \@subnodes,
address => undef, # filled in by resolve()
previous => undef, # filled in by resolve()
next => undef, # filled in by resolve()
}, $class;
name => $name,
subnodes => \@subnodes,
address => undef, # filled in by resolve()
previous => undef, # filled in by resolve()
next => undef, # filled in by resolve()
}, $class;
+
+ return $this;
}
=head2 name()
}
=head2 name()
diff --git
a/lib/ZOOM/IRSpy/Record.pm
b/lib/ZOOM/IRSpy/Record.pm
index
7444d70
..
e80fe12
100644
(file)
--- a/
lib/ZOOM/IRSpy/Record.pm
+++ b/
lib/ZOOM/IRSpy/Record.pm
@@
-8,6
+8,7
@@
use 5.008;
use strict;
use warnings;
use strict;
use warnings;
+use Scalar::Util;
use XML::LibXML;
use XML::LibXML::XPathContext;
use ZOOM::IRSpy::Utils qw(xml_encode isodate irspy_xpath_context);
use XML::LibXML;
use XML::LibXML::XPathContext;
use ZOOM::IRSpy::Utils qw(xml_encode isodate irspy_xpath_context);
@@
-36,12
+37,17
@@
sub new {
### Parser should be in the IRSpy object
my $parser = new XML::LibXML();
### Parser should be in the IRSpy object
my $parser = new XML::LibXML();
- return bless {
+ my $this = bless {
irspy => $irspy,
target => $target,
parser => $parser,
zeerex => $parser->parse_string($zeerex)->documentElement(),
}, $class;
irspy => $irspy,
target => $target,
parser => $parser,
zeerex => $parser->parse_string($zeerex)->documentElement(),
}, $class;
+
+ #Scalar::Util::weaken($this->{irspy});
+ #Scalar::Util::weaken($this->{parser});
+
+ return $this;
}
}
diff --git
a/lib/ZOOM/IRSpy/Stats.pm
b/lib/ZOOM/IRSpy/Stats.pm
index
af667dc
..
f701740
100644
(file)
--- a/
lib/ZOOM/IRSpy/Stats.pm
+++ b/
lib/ZOOM/IRSpy/Stats.pm
@@
-5,6
+5,8
@@
package ZOOM::IRSpy::Stats;
use 5.008;
use strict;
use warnings;
use 5.008;
use strict;
use warnings;
+
+use Scalar::Util;
use ZOOM::IRSpy::Utils qw(irspy_xpath_context);
=head1 NAME
use ZOOM::IRSpy::Utils qw(irspy_xpath_context);
=head1 NAME
diff --git
a/lib/ZOOM/IRSpy/Task.pm
b/lib/ZOOM/IRSpy/Task.pm
index
8e3f251
..
4340198
100644
(file)
--- a/
lib/ZOOM/IRSpy/Task.pm
+++ b/
lib/ZOOM/IRSpy/Task.pm
@@
-6,6
+6,8
@@
use 5.008;
use strict;
use warnings;
use strict;
use warnings;
+use Scalar::Util;
+
=head1 NAME
ZOOM::IRSpy::Task - base class for tasks in IRSpy
=head1 NAME
ZOOM::IRSpy::Task - base class for tasks in IRSpy
@@
-34,7
+36,7
@@
sub new {
my $class = shift();
my($conn, $udata, $options, %cb) = @_;
my $class = shift();
my($conn, $udata, $options, %cb) = @_;
- return bless {
+ my $this = bless {
irspy => $conn->{irspy},
conn => $conn,
udata => $udata,
irspy => $conn->{irspy},
conn => $conn,
udata => $udata,
@@
-42,6
+44,11
@@
sub new {
cb => \%cb,
timeRegistered => time(),
}, $class;
cb => \%cb,
timeRegistered => time(),
}, $class;
+
+ #Scalar::Util::weaken($this->{irspy});
+ #Scalar::Util::weaken($this->{udata});
+
+ return $this;
}
}
diff --git
a/lib/ZOOM/IRSpy/Test.pm
b/lib/ZOOM/IRSpy/Test.pm
index
e73061a
..
765cd4f
100644
(file)
--- a/
lib/ZOOM/IRSpy/Test.pm
+++ b/
lib/ZOOM/IRSpy/Test.pm
@@
-6,6
+6,8
@@
use 5.008;
use strict;
use warnings;
use strict;
use warnings;
+use Scalar::Util;
+
=head1 NAME
ZOOM::IRSpy::Test - base class for tests in IRSpy
=head1 NAME
ZOOM::IRSpy::Test - base class for tests in IRSpy
diff --git
a/lib/ZOOM/IRSpy/Utils.pm
b/lib/ZOOM/IRSpy/Utils.pm
index
0b1f646
..
b1d2331
100644
(file)
--- a/
lib/ZOOM/IRSpy/Utils.pm
+++ b/
lib/ZOOM/IRSpy/Utils.pm
@@
-6,6
+6,8
@@
use 5.008;
use strict;
use warnings;
use strict;
use warnings;
+use Scalar::Util;
+
use Exporter 'import';
our @EXPORT_OK = qw(utf8param
isodate
use Exporter 'import';
our @EXPORT_OK = qw(utf8param
isodate