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 authored and Facebook Github Bot committed 2017-04-27 11:47:57 -07:00
1 parent ee91eb7401
commit 8478767044
3 files changed
+27 -16

No files matched your search

@@ -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);