feat: Provide API to release the native object wrapped by a JS one (#6873)

* Add `releaseNativeObject` function in `utils`
* Add tests
* Add typings for the global `__releaseNativeCounterpart` functions
provided by Android and iOS runtimes

refs https://github.com/NativeScript/ios-runtime/issues/1062 and https://github.com/NativeScript/android-runtime/issues/1254
This commit is contained in:
Martin Bektchiev
2019-02-08 10:42:51 +02:00
committed by Svetoslav
parent 9f8d24a811
commit 8b4a9b3c6b
10 changed files with 111 additions and 17 deletions

View File

@@ -206,6 +206,10 @@ export function GC() {
gc();
}
export function releaseNativeObject(object: java.lang.Object) {
__releaseNativeCounterpart(object);
}
export function openUrl(location: string): boolean {
const context = ad.getApplicationContext();
try {