Merge pull request #981 from mythodeia/master

initialise kPNGSignatureData data
This commit is contained in:
Bogdan Poplauschi 2014-12-17 10:52:23 +02:00
commit 6b137fb8ba
1 changed files with 3 additions and 1 deletions

View File

@ -48,7 +48,6 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
static id instance; static id instance;
dispatch_once(&once, ^{ dispatch_once(&once, ^{
instance = [self new]; instance = [self new];
kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8];
}); });
return instance; return instance;
} }
@ -61,6 +60,9 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
if ((self = [super init])) { if ((self = [super init])) {
NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns]; NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns];
// initialise PNG signature data
kPNGSignatureData = [NSData dataWithBytes:kPNGSignatureBytes length:8];
// Create IO serial queue // Create IO serial queue
_ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL); _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL);