Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call invalidate on ViewManager on context destroy #37481

Closed
wants to merge 1 commit into from

Conversation

javache
Copy link
Member

@javache javache commented May 18, 2023

Summary:
ViewManagers inherit from BaseJavaModule so we should honour the same lifecycle for them as we do for native modules, which is to call invalidate / onCatalystInstanceDestroy when the ReactContext is destroyed. This allows the ViewManager to do any cleanup which cannot happen at the View level.

Changelog: [Android][Fixed] ViewManagers now receive an invalidate callback

Differential Revision: D45945678

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels May 18, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D45945678

@analysis-bot
Copy link

analysis-bot commented May 18, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,732,388 +69
android hermes armeabi-v7a 8,043,579 +42
android hermes x86 9,222,500 +83
android hermes x86_64 9,074,481 +28
android jsc arm64-v8a 9,297,693 +278
android jsc armeabi-v7a 8,486,443 +288
android jsc x86 9,358,863 +282
android jsc x86_64 9,614,960 +290

Base commit: f10dd3f
Branch: main

Summary:
Pull Request resolved: facebook#37481

ViewManagers inherit from BaseJavaModule so we should honour the same lifecycle  for them as we do for native modules, which is to call `invalidate` / `onCatalystInstanceDestroy` when the ReactContext is destroyed. This allows the ViewManager to do any cleanup which cannot happen at the View level.

Changelog: [Android][Fixed] ViewManagers now receive an invalidate callback

Reviewed By: cortinico

Differential Revision: D45945678

fbshipit-source-id: 158832c5fc61697d090fe306088314ab20f26c81
@javache javache force-pushed the export-D45945678 branch from 59f5f98 to 8e78f48 Compare May 19, 2023 14:55
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D45945678

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 19, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c5e7cd4.

@javache javache deleted the export-D45945678 branch May 23, 2023 08:47
fortmarek pushed a commit that referenced this pull request Dec 19, 2023
Summary:
Pull Request resolved: #37481

ViewManagers inherit from BaseJavaModule so we should honour the same lifecycle  for them as we do for native modules, which is to call `invalidate` / `onCatalystInstanceDestroy` when the ReactContext is destroyed. This allows the ViewManager to do any cleanup which cannot happen at the View level.

Changelog: [Android][Fixed] ViewManagers now receive an invalidate callback

Reviewed By: cortinico

Differential Revision: D45945678

fbshipit-source-id: 27c26d951b50a734c42eb033a46e599ef939e29f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants