wrap CREATE_MODULE and INITIALIZE_MODULE markers with try/finally

Reviewed By: alexeylang

Differential Revision: D4961142

fbshipit-source-id: 7d25103b2839f15bb6a913eba7eb60ef0b07eb23
This commit is contained in:
Aaron Chiu
2017-04-27 11:34:21 -07:00
committed by Facebook Github Bot
parent ee91eb7401
commit 8478767044
3 changed files with 27 additions and 16 deletions

View File

@@ -75,13 +75,13 @@ public abstract class LazyReactPackage implements ReactPackage {
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createNativeModule")
.arg("module", holder.getType())
.flush();
ReactMarker.logMarker(
ReactMarkerConstants.CREATE_MODULE_START,
holder.getType().getSimpleName());
try {
ReactMarker.logMarker(
ReactMarkerConstants.CREATE_MODULE_START,
holder.getType().getSimpleName());
nativeModule = holder.getProvider().get();
ReactMarker.logMarker(ReactMarkerConstants.CREATE_MODULE_END);
} finally {
ReactMarker.logMarker(ReactMarkerConstants.CREATE_MODULE_END);
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}
modules.add(nativeModule);