summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stream.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index 32467082..9e88eca1 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -685,11 +685,6 @@ dbgprintf("XXX: destruct stream %p\n", pThis);
if(pThis->fd != -1)
strmCloseFile(pThis);
- free(pThis->pszDir);
- free(pThis->pZipBuf);
- free(pThis->pszCurrFName);
- free(pThis->pszFName);
-
if(pThis->bAsyncWrite) {
stopWriter(pThis);
pthread_mutex_destroy(&pThis->mut);
@@ -702,6 +697,15 @@ dbgprintf("XXX: destruct stream %p\n", pThis);
} else {
free(pThis->pIOBuf);
}
+
+ /* IMPORTANT: we MUST free this only AFTER the ansyncWriter has been stopped, else
+ * we get random errors...
+ */
+ free(pThis->pszDir);
+ free(pThis->pZipBuf);
+ free(pThis->pszCurrFName);
+ free(pThis->pszFName);
+
ENDobjDestruct(strm)