Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/imagepicker.ios.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as data_observable from "tns-core-modules/data/observable";
import * as frame from "tns-core-modules/ui/frame";
import * as imageAssetModule from "tns-core-modules/image-asset";
import { Options, ImagePickerMediaType } from ".";
import { View } from "tns-core-modules/ui/core/view/view";
import * as utils from "tns-core-modules/utils/utils";

const defaultAssetCollectionSubtypes: NSArray<any> = NSArray.arrayWithArray(<any>[
PHAssetCollectionSubtype.SmartAlbumRecentlyAdded,
Expand Down Expand Up @@ -102,7 +102,13 @@ export class ImagePickerControllerDelegate extends NSObject implements QBImagePi

this._resolve(assets);

imagePickerController.dismissViewControllerAnimatedCompletion(true, null);
imagePickerController.dismissViewControllerAnimatedCompletion(true, () => {
// FIX: possible memory issue when picking images many times.
// Not the best solution, but the only one working for now
// https://github.com/NativeScript/nativescript-imagepicker/issues/222
setTimeout(utils.GC, 200);
});

}

public static ObjCProtocols = [QBImagePickerControllerDelegate];
Expand Down