Browse Source

fix synchronization error in lrucache's loaditems

Alan Shreve 11 years ago
parent
commit
278b93383e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/ngrok/cache/lru.go

+ 1 - 1
src/ngrok/cache/lru.go

@@ -188,7 +188,7 @@ func (lru *LRUCache) LoadItems(r io.Reader) error {
 	}
 	}
 
 
 	lru.mu.Lock()
 	lru.mu.Lock()
-	lru.mu.Unlock()
+	defer lru.mu.Unlock()
 	for _, item := range items {
 	for _, item := range items {
 		// XXX: copied from Set()
 		// XXX: copied from Set()
 		if element := lru.table[item.Key]; element != nil {
 		if element := lru.table[item.Key]; element != nil {