Skip to content

Commit 3c08964

Browse files
committed
Package Manager's queue can't be set to nil anymore.
1 parent 450c9c8 commit 3c08964

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cocos2d/CCPackageManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/**
3333
* The queue on which unzipping of packages is achieved, default is DISPATCH_QUEUE_PRIORITY_LOW.
3434
* On iOS 5.0, MacOS 10.7 and below you have to get rid of the queue after use if it's not a global one.
35+
* If set to nil, queue will be reset to default.
3536
*/
3637
#if OS_OBJECT_HAVE_OBJC_SUPPORT == 1
3738
@property (nonatomic, strong) dispatch_queue_t unzippingQueue;

cocos2d/CCPackageManager.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ - (void)setInstalledPackagesPath:(NSString *)installedPackagesPath
204204
[self didChangeValueForKey:@"installedPackagesPath"];
205205
}
206206

207+
- (void)setUnzippingQueue:(dispatch_queue_t)unzippingQueue
208+
{
209+
if (!unzippingQueue)
210+
{
211+
_unzippingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0);
212+
return;
213+
}
214+
215+
_unzippingQueue = unzippingQueue;
216+
}
217+
207218

208219
#pragma mark - download
209220

0 commit comments

Comments
 (0)