File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import * as data_observable from "tns-core-modules/data/observable" ;
2
- import * as frame from "tns-core-modules/ui/frame" ;
3
2
import * as imageAssetModule from "tns-core-modules/image-asset" ;
4
3
import { Options , ImagePickerMediaType } from "." ;
5
4
import { View } from "tns-core-modules/ui/core/view/view" ;
5
+ import * as utils from "tns-core-modules/utils/utils" ;
6
6
7
7
const defaultAssetCollectionSubtypes : NSArray < any > = NSArray . arrayWithArray ( < any > [
8
8
PHAssetCollectionSubtype . SmartAlbumRecentlyAdded ,
@@ -102,7 +102,13 @@ export class ImagePickerControllerDelegate extends NSObject implements QBImagePi
102
102
103
103
this . _resolve ( assets ) ;
104
104
105
- imagePickerController . dismissViewControllerAnimatedCompletion ( true , null ) ;
105
+ imagePickerController . dismissViewControllerAnimatedCompletion ( true , ( ) => {
106
+ // FIX: possible memory issue when picking images many times.
107
+ // Not the best solution, but the only one working for now
108
+ // https://github.com/NativeScript/nativescript-imagepicker/issues/222
109
+ setTimeout ( utils . GC , 200 ) ;
110
+ } ) ;
111
+
106
112
}
107
113
108
114
public static ObjCProtocols = [ QBImagePickerControllerDelegate ] ;
You can’t perform that action at this time.
0 commit comments