Selaa lähdekoodia

release imgRef to close memory leak

Simon Ermler 6 vuotta sitten
vanhempi
commit
c9ed64e07e
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1
    0
      ios/RNThumbnail.m

+ 1
- 0
ios/RNThumbnail.m Näytä tiedosto

38
         NSFileManager *fileManager = [NSFileManager defaultManager];
38
         NSFileManager *fileManager = [NSFileManager defaultManager];
39
         NSString *fullPath = [tempDirectory stringByAppendingPathComponent: [NSString stringWithFormat:@"thumb-%@.jpg", [[NSProcessInfo processInfo] globallyUniqueString]]];
39
         NSString *fullPath = [tempDirectory stringByAppendingPathComponent: [NSString stringWithFormat:@"thumb-%@.jpg", [[NSProcessInfo processInfo] globallyUniqueString]]];
40
         [fileManager createFileAtPath:fullPath contents:data attributes:nil];
40
         [fileManager createFileAtPath:fullPath contents:data attributes:nil];
41
+        CGImageRelease(imgRef);
41
         if (resolve)
42
         if (resolve)
42
             resolve(@{ @"path" : fullPath,
43
             resolve(@{ @"path" : fullPath,
43
                        @"width" : [NSNumber numberWithFloat: thumbnail.size.width],
44
                        @"width" : [NSNumber numberWithFloat: thumbnail.size.width],