From a56802f7c001699f2292afeb90dd9bad99391939 Mon Sep 17 00:00:00 2001 From: Jaakko Manninen Date: Thu, 31 Jan 2013 13:45:36 +0200 Subject: dont call cb unless defined in unlock, warn if unlocking twice --- lib/cache.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cache.js b/lib/cache.js index 33df21720..acde8bbf7 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -1096,8 +1096,12 @@ function LockFile(path) { LockFile.prototype.unlock = function(cb) { var self = this - if (!this.locked) - return cb() + if (!this.locked) { + console.trace() + console.warn('LockFile.unlock() called twice for '+this.path) + if (cb) cb() + return + } lockFile.unlock(this.path, function(er) { self.locked = false -- cgit v1.2.3