Skip to content

Commit

Permalink
added a session object class
Browse files Browse the repository at this point in the history
  • Loading branch information
ewolf committed Nov 21, 2016
1 parent 45c1648 commit 15af176
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion ServerYote/lib/Yote/Server/ModperlOperator.pm
Expand Up @@ -103,7 +103,6 @@ sub handle_request {
req => $req,
session => $session,
path => $path,
path_args => $path_args,
template => $template,
uri => $ruri,
} );
Expand Down
4 changes: 4 additions & 0 deletions YoteBase/ChangeLog
@@ -1,3 +1,7 @@
2016-11-20 eric wolf <coyocanid@gmail.com>
* Version 1.43
* fixed stupid weak major subtle reference bug. was referencing weakly references rather than thingies in some cases.

2016-10-30 eric wolf <coyocanid@gmail.com>
* Version 1.42
* added _DUMP and _DUMP_ALL methods for Yote::Obj
Expand Down
6 changes: 1 addition & 5 deletions YoteBase/lib/Yote.pm
Expand Up @@ -358,7 +358,6 @@ sub __get_id {
my $tied = tied @$ref;
if( $tied ) {
$tied->[0] ||= $self->{_DATASTORE}->_get_id( "ARRAY" );
$self->_store_weak( $tied->[0], $ref );
return $tied->[0];
}
my( @data ) = @$ref;
Expand All @@ -378,7 +377,6 @@ sub __get_id {
my $tied = tied %$ref;
if( $tied ) {
$tied->[0] ||= $self->{_DATASTORE}->_get_id( "HASH" );
$self->_store_weak( $tied->[0], $ref );
return $tied->[0];
}
my $id = $self->{_DATASTORE}->_get_id( $class );
Expand All @@ -400,7 +398,6 @@ sub __get_id {
} else {
$ref->{ID} ||= $self->{_DATASTORE}->_get_id( $class );
}
$self->_store_weak( $ref->{ID}, $ref );

return $ref->{ID};
}
Expand Down Expand Up @@ -1187,11 +1184,10 @@ sub _recycle_objects {
# This ignores the possibility of circular references, but that uncommon case
# is not worth the complexity.
#
for my $referenced_id ( keys %{ $self->{OBJ_STORE}{_WEAK_REFS} } ) {
for my $referenced_id ( grep { defined($self->{OBJ_STORE}{_WEAK_REFS}{$_}) } keys %{ $self->{OBJ_STORE}{_WEAK_REFS} } ) {
# make sure that these are actually referenced. They may be
# in DIRTY, and, if they are Yote::Array or Yote::Hash, they
# have an extra reference due to the tie.

my $obj = $self->{OBJ_STORE}->fetch( $referenced_id );
my $min_ref_count = 1;
if( $self->{OBJ_STORE}->_is_dirty( $referenced_id ) ) {
Expand Down
10 changes: 5 additions & 5 deletions YoteBase/t/yotedb.t
Expand Up @@ -6,7 +6,7 @@ use Yote;
use Data::Dumper;
use File::Temp qw/ :mktemp tempdir /;
use Test::More;

use Devel::Refcount 'refcount';
use Carp;
$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };

Expand All @@ -24,7 +24,6 @@ done_testing;

exit( 0 );


sub test_suite {

my $store = Yote::open_store( $dir );
Expand All @@ -40,7 +39,7 @@ sub test_suite {
} ),
} ),
} );

is( $root_node->get_myList->[0]{objy}->get_somename, 'Käse', "utf 8 character defore stow" );

$store->stow_all;
Expand Down Expand Up @@ -95,9 +94,10 @@ sub test_suite {
undef $list_to_remove;

is( $store->run_recycler, 1, "just list is removed. it is not referenced by other removed items that still have references." );

use Scalar::Util qw( refaddr );

undef $hash_in_list;

is( $store->run_recycler, 3, "all 3 remaining things that can't trace to the root are removed" );

} #test suite
Expand Down

0 comments on commit 15af176

Please sign in to comment.