Merge pull request #28 from moteus/patch-1

Fix. Prevents double close the same handle (#24)
This commit is contained in:
Hisham Muhammad
2014-01-08 06:53:06 -08:00

View File

@@ -281,7 +281,10 @@ static int lfs_lock_dir(lua_State *L) {
}
static int lfs_unlock_dir(lua_State *L) {
lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE);
if(lock->fd != INVALID_HANDLE_VALUE) {
CloseHandle(lock->fd);
lock->fd=INVALID_HANDLE_VALUE;
}
return 0;
}
#else