aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFileHandle.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-04-12 23:48:20 +0000
committerrowanbeentje <rowan@beent.je>2012-04-12 23:48:20 +0000
commit5ce91070b5ff229de819d5e4b68fcae72297f634 (patch)
tree25763d533323cdee786d8dc629ec1310f7b30892 /Source/SPFileHandle.m
parent25b0b6857cd501277790c64d90850e1ddf56e5af (diff)
downloadsequelpro-5ce91070b5ff229de819d5e4b68fcae72297f634.tar.gz
sequelpro-5ce91070b5ff229de819d5e4b68fcae72297f634.tar.bz2
sequelpro-5ce91070b5ff229de819d5e4b68fcae72297f634.zip
- Manually handle some SPFileHandle memory management to significantly improve memory usage during large exports, particularly improving memory which appeared to never be reclaimed
- Fix some minor memory leaks throughout the application
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];