Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Memory leak fixes #1823

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/mlkit/mlkit-cameraview.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ class TNSMLKitCameraViewDelegateImpl extends NSObject implements TNSMLKitCameraV
} else {
this.owner.get().runDetector(image, onComplete);
}
image = null;
// 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);
}

private uiImageToFIRVisionImage(image: UIImage): FIRVisionImage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ + (NSMutableData * _Nullable)getInputData:(nonnull UIImage *)img withRows:(int)
}
}
}

CGContextRelease(context);
return inputData;
}

Expand Down