Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Janic Duplessis 9ef5107d04 Release underlying resources when JS instance in GC'ed (#24745)
Summary:
Our Blob implementation was very problematic because it didn't release its underlying resource when the JS instance was dealocated. The main issue is that the fetch polyfill uses blobs by default if the module is available, which causes large memory leaks.

This fixes it by using the new jsi infra to attach a `jsi::HostObject` (`BlobCollector`)  to `Blob` instances. This way when the `Blob` is collected, the `BlobCollector` also gets collected. Using the `jsi::HostObject` dtor we can schedule the cleanup of native resources. This is definitely not the ideal solution but otherwise it would require rewriting the whole module using TurboModules + jsi.

Fixes #23801, #20352, #21092

[General] [Fixed] - [Blob] Release underlying resources when JS instance in GC'ed
Pull Request resolved: https://github.com/facebook/react-native/pull/24745

Reviewed By: fkgozali

Differential Revision: D15248848

Pulled By: hramos

fbshipit-source-id: 1da835cc935dfbf4e7bb6fbf2aea29bfdc9bd6fa
2019-05-08 14:15:09 -07:00
Zeyad Salloum 05baf62721 Revert D15237418: [react-native][PR] [Blob] Release underlying resources when JS instance in GC'ed on iOS
Differential Revision:
D15237418

Original commit changeset: 00a94a54b0b1

fbshipit-source-id: bb6c7aa3f5b6ae7f40965b96f1e0fd8eb7512015
2019-05-07 03:03:04 -07:00
Janic Duplessis c5c79e5d71 Release underlying resources when JS instance in GC'ed on iOS (#24405)
Summary:
Our Blob implementation was very problematic because it didn't release its underlying resource when the JS instance was dealocated. The main issue is that the fetch polyfill uses blobs by default if the module is available, which causes large memory leaks.

This fixes it by using the new jsi infra to attach a `jsi::HostObject` (`BlobCollector`)  to `Blob` instances. This way when the `Blob` is collected, the `BlobCollector` also gets collected. Using the `jsi::HostObject` dtor we can schedule the cleanup of native resources. This is definitely not the ideal solution but otherwise it would require rewriting the whole module using TurboModules + jsi.

Fixes #23801, #20352, #21092

[General] [Fixed] - [Blob] Release underlying resources when JS instance in GC'ed
Pull Request resolved: https://github.com/facebook/react-native/pull/24405

Differential Revision: D15237418

Pulled By: cpojer

fbshipit-source-id: 00a94a54b0b172fbc62324364b753d192ac7016a
2019-05-07 02:03:57 -07:00