Reset NodeRegion when a node gets mounted to a View

Summary: Small optimization. Once we mount a Node to a View, its NodeRegion is not used anymore with RCTText being an exception, but it will correct itself automatically upon updateNodeRegion call. This patch allows the dead object to get garbage collected.

Reviewed By: ahmedre

Differential Revision: D2816331
This commit is contained in:
Denis Koroskin 2016-01-11 18:06:45 -08:00 committed by Ahmed El-Helw
parent 7075744b94
commit 2fb7ebfb7b
1 changed files with 3 additions and 0 deletions

View File

@ -263,6 +263,9 @@ import com.facebook.react.uimanager.ViewProps;
if (getParent() != null) {
invalidate();
}
// reset NodeRegion to allow it getting garbage-collected
mNodeRegion = NodeRegion.EMPTY;
}
}