--- loncom/interface/lonnavmaps.pm 2003/01/14 17:19:27 1.129 +++ loncom/interface/lonnavmaps.pm 2003/01/14 18:47:50 1.130 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.129 2003/01/14 17:19:27 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.130 2003/01/14 18:47:50 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,6 +46,24 @@ use Apache::Constants qw(:common :http); use Apache::loncommon(); use POSIX qw (floor strftime); +my %navmaphash; +my %parmhash; + +sub cleanup { + if (tied(%navmaphash)){ + &Apache::lonnet::logthis('Cleanup navmaps: navmaphash'); + unless (untie(%navmaphash)) { + &Apache::lonnet::logthis('Failed cleanup navmaps: navmaphash'); + } + } + if (tied(%parmhash)){ + &Apache::lonnet::logthis('Cleanup navmaps: parmhash'); + unless (untie(%parmhash)) { + &Apache::lonnet::logthis('Failed cleanup navmaps: parmhash'); + } + } +} + sub handler { my $r = shift; real_handler($r); @@ -985,13 +1003,12 @@ sub new { $self->{NETWORK_FAILURE} = 0; # tie the nav hash - my %navmaphash; + if (!(tie(%navmaphash, 'GDBM_File', $self->{NAV_HASH_FILE}, &GDBM_READER(), 0640))) { return undef; } - my %parmhash; if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE}, &GDBM_READER(), 0640))) {