--- loncom/interface/lonnavmaps.pm 2003/03/13 17:05:36 1.156 +++ loncom/interface/lonnavmaps.pm 2003/03/20 20:40:18 1.164 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.156 2003/03/13 17:05:36 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.164 2003/03/20 20:40:18 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,7 @@ use POSIX qw (floor strftime); my %navmaphash; my %parmhash; +my @refsToUntie; # symbolic constants sub SYMB { return 1; } @@ -98,8 +99,12 @@ my %colormap = # And a special case in the nav map; what to do when the assignment # is not yet done and due in less then 24 hours my $hurryUpColor = "#FF0000"; - +my $test = 'abc'; sub cleanup { + &Apache::lonnet::logthis("Cleanup called."); + &Apache::lonnet::logthis(scalar(@refsToUntie)); + &Apache::lonnet::logthis($test); + $test = '467'; if (tied(%navmaphash)){ &Apache::lonnet::logthis('Cleanup navmaps: navmaphash'); unless (untie(%navmaphash)) { @@ -112,6 +117,14 @@ sub cleanup { &Apache::lonnet::logthis('Failed cleanup navmaps: parmhash'); } } + # Apparently, if you take a reference to a tied hash, both the + # original hash and the tied hash must be untied. Bleh. + for my $ref (@refsToUntie) { + &Apache::lonnet::logthis('Cleanup navmaps: reference'); + unless (untie($ref)) { + &Apache::lonnet::logthis('Failed cleanup navmaps: reference'); + } + } } sub handler { @@ -143,7 +156,7 @@ sub real_handler { $r->send_http_header; # Create the nav map - my $navmap = Apache::lonnavmaps::navmap->new( + my $navmap = Apache::lonnavmaps::navmap->new($r, $ENV{"request.course.fn"}.".db", $ENV{"request.course.fn"}."_parms.db", 1, 1); @@ -158,6 +171,7 @@ sub real_handler { $r->print("