Commit f5751e45 by rfkelly0

dokan: fix notepad bug by moving file.close() back into CloseFile

parent 8cb6ad8e
...@@ -334,7 +334,11 @@ class FSOperations(DokanOperations): ...@@ -334,7 +334,11 @@ class FSOperations(DokanOperations):
self._del_file(info.contents.Context) self._del_file(info.contents.Context)
finally: finally:
lock.release() lock.release()
elif info.contents.Context >= MIN_FH: info.contents.Context = 0
@handle_fs_errors
def CloseFile(self, path, info):
if info.contents.Context >= MIN_FH:
(file,_,lock) = self._get_file(info.contents.Context) (file,_,lock) = self._get_file(info.contents.Context)
lock.acquire() lock.acquire()
try: try:
...@@ -342,12 +346,7 @@ class FSOperations(DokanOperations): ...@@ -342,12 +346,7 @@ class FSOperations(DokanOperations):
self._del_file(info.contents.Context) self._del_file(info.contents.Context)
finally: finally:
lock.release() lock.release()
info.contents.Context = 0 info.contents.Context = 0
@handle_fs_errors
def CloseFile(self, path, info):
if info.contents.Context != 0:
raise FSError("file handle not cleaned up: %s" % (path,))
@handle_fs_errors @handle_fs_errors
def ReadFile(self, path, buffer, nBytesToRead, nBytesRead, offset, info): def ReadFile(self, path, buffer, nBytesToRead, nBytesRead, offset, info):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment