Skip to content

Commit e9c5a5e

Browse files
YangSen-qnYangSen-qn
andauthored
version to v8.9.1 (#454)
Co-authored-by: YangSen-qn <[email protected]>
1 parent 5d86b84 commit e9c5a5e

File tree

7 files changed

+29
-8
lines changed

7 files changed

+29
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#Changelog
2+
## 8.9.1 (2025-08-20)
3+
- 修复回调问题
4+
25
## 8.9.0 (2025-06-12)
36
- 分片上传默认使用 V2 接口
47

Qiniu.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Qiniu'
3-
s.version = '8.9.0'
3+
s.version = '8.9.1'
44
s.summary = 'Qiniu Resource Storage SDK for iOS and Mac'
55
s.homepage = 'https://github.com/qiniu/objc-sdk'
66
s.social_media_url = 'http://weibo.com/qiniutek'

QiniuSDK/Storage/QNFormUpload.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@
1414

1515
@interface QNFormUpload ()
1616

17+
@property(nonatomic, strong)NSLock *locker;
1718
@property(nonatomic, strong)QNUpProgress *progress;
18-
1919
@property(nonatomic, strong)QNRequestTransaction *uploadTransaction;
2020

2121
@end
2222

2323
@implementation QNFormUpload
2424

25+
- (void)initData {
26+
[super initData];
27+
28+
_locker = [[NSLock alloc] init];
29+
}
30+
2531
- (void)startToUpload {
2632
[super startToUpload];
2733

@@ -61,9 +67,11 @@ - (void)startToUpload {
6167
}
6268

6369
- (QNUpProgress *)progress {
70+
[self.locker lock];
6471
if (_progress == nil) {
6572
_progress = [QNUpProgress progress:self.option.progressHandler byteProgress:self.option.byteProgressHandler];
6673
}
74+
[self.locker unlock];
6775
return _progress;
6876
}
6977

QiniuSDK/Storage/QNPartsUploadPerformer.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ - (instancetype)initWithSource:(id<QNUploadSource>)uploadSource
6363
_config = config;
6464
_recorder = config.recorder;
6565
_recorderKey = recorderKey;
66-
66+
_progressLocker = [[NSLock alloc] init];
6767
[self initData];
6868
}
6969
return self;
@@ -100,10 +100,15 @@ - (void)notifyProgress:(BOOL)isCompleted {
100100
return;
101101
}
102102

103+
QNUpProgress *progress = self.progress;
104+
if (progress == nil) {
105+
return;
106+
}
107+
103108
if (isCompleted) {
104-
[self.progress notifyDone:self.key totalBytes:[self.uploadInfo getSourceSize]];
109+
[progress notifyDone:self.key totalBytes:[self.uploadInfo getSourceSize]];
105110
} else {
106-
[self.progress progress:self.key uploadBytes:[self.uploadInfo uploadSize] totalBytes:[self.uploadInfo getSourceSize]];
111+
[progress progress:self.key uploadBytes:[self.uploadInfo uploadSize] totalBytes:[self.uploadInfo getSourceSize]];
107112
}
108113
}
109114

QiniuSDK/Storage/QNUpProgress.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "QNAsyncRun.h"
10+
#import "QNDefine.h"
1011
#import "QNUpProgress.h"
1112

1213
@interface QNUpProgress()
@@ -66,7 +67,9 @@ - (void)notify:(NSString *)key uploadBytes:(long long)uploadBytes totalBytes:(lo
6667
}
6768

6869
if (self.byteProgress) {
70+
kQNWeakSelf;
6971
QNAsyncRunInMain(^{
72+
kQNStrongSelf;
7073
self.byteProgress(key, uploadBytes, totalBytes);
7174
});
7275
return;
@@ -77,7 +80,9 @@ - (void)notify:(NSString *)key uploadBytes:(long long)uploadBytes totalBytes:(lo
7780
}
7881

7982
if (self.progress) {
83+
kQNWeakSelf;
8084
QNAsyncRunInMain(^{
85+
kQNStrongSelf;
8186
double notifyPercent = (double) uploadBytes / (double) totalBytes;
8287
self.progress(key, notifyPercent);
8388
});

QiniuSDK/Utils/QNVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
/**
1212
* sdk 版本
1313
*/
14-
static NSString *const kQiniuVersion = @"8.9.0";
14+
static NSString *const kQiniuVersion = @"8.9.1";

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
通过 CocoaPods
1515

1616
```ruby
17-
pod "Qiniu", "~> 8.8.1"
17+
pod "Qiniu", "~> 8.9.1"
1818
```
1919

2020
通过 Swift Package Manager (Xcode 11+)
@@ -26,7 +26,7 @@ File -> Swift Packages -> Add Package Dependency,输入库链接,选择相
2626
库对接:
2727
let package = Package(
2828
dependencies: [
29-
.package(url: "https://github.com/qiniu/objc-sdk", from: "8.9.0")
29+
.package(url: "https://github.com/qiniu/objc-sdk", from: "8.9.1")
3030
],
3131
// ...
3232
)

0 commit comments

Comments
 (0)