small fix for nanobench segfault when not running any tests
authorjoshualitt <joshualitt@chromium.org>
Thu, 26 Mar 2015 17:41:02 +0000 (10:41 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 26 Mar 2015 17:41:02 +0000 (10:41 -0700)
BUG=skia:

Review URL: https://codereview.chromium.org/1030353004

bench/nanobench.cpp

index 920979c..5e05932 100644 (file)
@@ -894,6 +894,12 @@ int nanobench_main() {
     log->config("meta");
     log->metric("max_rss_mb", sk_tools::getMaxResidentSetSizeMB());
 
+#if SK_SUPPORT_GPU
+    // Make sure we clean up the global GrContextFactory here, otherwise we might race with the
+    // SkEventTracer destructor
+    gGrFactory.reset(NULL);
+#endif
+
     return 0;
 }