Bug 692185 - Flush PrintWriter prior to extracting printed string; r=blassey

Not flushing the PrintWriter might cause data to get left in the PrintWriter's
internal buffers, and not get written into the underlying StringWriter. This
might explain why the stack trace does not get written out to the crash report.
This commit is contained in:
Kartikaya Gupta 2011-11-08 16:41:50 -05:00
parent a9396bac02
commit 8b295cc6ce

View File

@ -358,7 +358,9 @@ abstract public class GeckoApp
} catch (Exception e) {
Log.e(LOG_FILE_NAME, "top level exception", e);
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.flush();
GeckoAppShell.reportJavaCrash(sw.toString());
}
// resetting this is kinda pointless, but oh well