From e1fed608e877ad081de1b04ef87f78f339209bd9 Mon Sep 17 00:00:00 2001 From: Andy Street Date: Tue, 16 Feb 2016 10:07:35 -0800 Subject: [PATCH] Fix double-destruct of string on syntax error Reviewed By: davidaurelio Differential Revision: D2939260 fb-gh-sync-id: b080b70aae7e33297d549d387e40bde07f4fc765 shipit-source-id: b080b70aae7e33297d549d387e40bde07f4fc765 --- ReactAndroid/src/main/jni/react/JSCHelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/jni/react/JSCHelpers.cpp b/ReactAndroid/src/main/jni/react/JSCHelpers.cpp index 0711c273f..b18e965c6 100644 --- a/ReactAndroid/src/main/jni/react/JSCHelpers.cpp +++ b/ReactAndroid/src/main/jni/react/JSCHelpers.cpp @@ -55,7 +55,7 @@ JSValueRef evaluateScript(JSContextRef context, JSStringRef script, JSStringRef auto line = exception.asObject().getProperty("line"); std::ostringstream locationInfo; - std::string file = source != nullptr ? String::adopt(source).str() : ""; + std::string file = source != nullptr ? String::ref(source).str() : ""; locationInfo << "(" << (file.length() ? file : ""); if (line != nullptr && line.isNumber()) { locationInfo << ":" << line.asInteger();