[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Tue, 01 Oct 2002 19:39:11 -0000


bowersj2		Tue Oct  1 15:39:11 2002 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Hey, I have an idea, let's untie the hashes *correctly*! Woohoo! Go me!
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.59 loncom/interface/lonnavmaps.pm:1.60
--- loncom/interface/lonnavmaps.pm:1.59	Tue Oct  1 15:15:22 2002
+++ loncom/interface/lonnavmaps.pm	Tue Oct  1 15:39:11 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.59 2002/10/01 19:15:22 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.60 2002/10/01 19:39:11 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1272,6 +1272,7 @@
     if (!(tie(%parmhash, 'GDBM_File', $self->{PARM_HASH_FILE},
               &GDBM_READER(), 0640)))
     {
+	untie $self->{PARM_HASH};
         return undef;
     }
     $self->{PARM_HASH} = \%parmhash;
@@ -1405,8 +1406,8 @@
 # unties the hash when done
 sub untieHashes {
     my $self = shift;
-    untie $self->{NAV_HASH} if ($self->{HASH_TIED});
-    untie $self->{PARM_HASH} if ($self->{HASH_TIED});
+    untie %{$self->{NAV_HASH}} if ($self->{HASH_TIED});
+    untie %{$self->{PARM_HASH}} if ($self->{HASH_TIED});
     $self->{HASH_TIED} = 0;
 }