Change the signature of onDropViewInstance. issue #5053

Summary:
https://github.com/facebook/react-native/issues/5053
Closes https://github.com/facebook/react-native/pull/5125

Reviewed By: svcscm

Differential Revision: D2807202

Pulled By: foghina

fb-gh-sync-id: 1e268c940a08aa7bf243971ba91d4595973f12af
This commit is contained in:
SangYeob Bono Yu 2016-01-06 06:56:49 -08:00 committed by facebook-github-bot-9
parent 1bfd267acb
commit daa93a6222
3 changed files with 5 additions and 7 deletions

View File

@ -424,9 +424,7 @@ public class NativeViewHierarchyManager {
UiThreadUtil.assertOnUiThread();
if (!mRootTags.get(view.getId())) {
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
resolveViewManager(view.getId()).onDropViewInstance(
(ThemedReactContext) view.getContext(),
view);
resolveViewManager(view.getId()).onDropViewInstance(view);
}
ViewManager viewManager = mTagsToViewManagers.get(view.getId());
if (view instanceof ViewGroup && viewManager instanceof ViewGroupManager) {

View File

@ -92,7 +92,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
* Called when view is detached from view hierarchy and allows for some additional cleanup by
* the {@link ViewManager} subclass.
*/
public void onDropViewInstance(ThemedReactContext reactContext, T view) {
public void onDropViewInstance(T view) {
}
/**

View File

@ -323,9 +323,9 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
}
@Override
public void onDropViewInstance(ThemedReactContext reactContext, WebView webView) {
super.onDropViewInstance(reactContext, webView);
reactContext.removeLifecycleEventListener((ReactWebView) webView);
public void onDropViewInstance(WebView webView) {
super.onDropViewInstance(webView);
((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((ReactWebView) webView);
((ReactWebView) webView).cleanupCallbacksAndDestroy();
}
}