small fix for nanobench segfault when not running any tests
BUG=skia:
Review URL: https://codereview.chromium.org/1030353004
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 920979c..5e05932 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -894,6 +894,12 @@
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;
}