Skip to content

Commit a8eb5c9

Browse files
authored
Merge pull request #244 from hehe520/hotfix/memory_leak_ck
【bugfix】修复一处内存泄漏
2 parents 721e0f8 + ad36e22 commit a8eb5c9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

QiniuDemo/QiniuDemo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
);
348348
runOnlyForDeploymentPostprocessing = 0;
349349
shellPath = /bin/sh;
350-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
350+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
351351
showEnvVarsInLog = 0;
352352
};
353353
ABE36606520E0BC28F0FB079 /* [CP] Copy Pods Resources */ = {
@@ -377,7 +377,7 @@
377377
);
378378
runOnlyForDeploymentPostprocessing = 0;
379379
shellPath = /bin/sh;
380-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
380+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
381381
showEnvVarsInLog = 0;
382382
};
383383
E7747219847A629D5312382A /* [CP] Embed Pods Frameworks */ = {

QiniuSDK/Http/QNSessionManager.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ - (instancetype)initWithProxy:(NSDictionary *)proxyDict
113113
return self;
114114
}
115115

116+
- (void)dealloc {
117+
// 释放前,关闭 AFN 的 session,不然AFN内部有循环引用,导致内存无法释放,如果创建了多个 QNUploadManager 将丢多次内存
118+
if (self.httpManager) {
119+
[self.httpManager.session finishTasksAndInvalidate];
120+
}
121+
}
122+
116123
+ (AFHTTPSessionManager *)httpManagerWithProxy:(NSDictionary *)proxyDict {
117124
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
118125
if (proxyDict != nil) {

0 commit comments

Comments
 (0)