aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFileHandle.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFileHandle.m')
-rw-r--r--Source/SPFileHandle.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/SPFileHandle.m b/Source/SPFileHandle.m
index 3701fc8c..94c26211 100644
--- a/Source/SPFileHandle.m
+++ b/Source/SPFileHandle.m
@@ -414,7 +414,7 @@
}
// Copy the data into a local buffer
- NSData *dataToBeWritten = [NSData dataWithData:buffer];
+ NSData *dataToBeWritten = [buffer copy];
[buffer setLength:0];
bufferDataLength = 0;
pthread_mutex_unlock(&bufferLock);
@@ -453,6 +453,8 @@
allDataWritten = YES;
}
pthread_mutex_unlock(&bufferLock);
+
+ [dataToBeWritten release];
}
[writePool drain];