summaryrefslogtreecommitdiff
path: root/src/chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk.c')
-rw-r--r--src/chunk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/chunk.c b/src/chunk.c
index 37ca9e5e..8d5efae1 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -193,6 +193,12 @@ chunk_file_pread (int fd, void *buf, size_t count, off_t offset)
static void chunk_reset_file_chunk(chunk *c) {
if (c->file.is_temp) {
c->file.is_temp = 0;
+ #ifdef _WIN32 /*(not expecting c->file.refchg w/ .is_temp)*/
+ if (!c->file.refchg && c->file.fd != -1) {
+ fdio_close_file(c->file.fd);
+ c->file.fd = -1;
+ }
+ #endif
if (!buffer_is_blank(c->mem))
unlink(c->mem->ptr);
}