Close an (incidental) memory leak in gmmain.
Create a suppressions file for gm so that valgrind doesn't warn about
dubious actions the driver takes. There *may* be one of those that we
could do something about...
http://codereview.appspot.com/5820056/
git-svn-id: http://skia.googlecode.com/svn/trunk@3396 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 523faf8..6f53ce8 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -728,6 +728,9 @@
SkISize size = gm->getISize();
maxW = SkMax32(size.width(), maxW);
maxH = SkMax32(size.height(), maxH);
+ // This fixes a memory leak, but we are churning gms; we could
+ // instead cache them if we have constructors with side-effects.
+ SkDELETE(gm);
}
// setup a GL context for drawing offscreen
SkAutoTUnref<SkGLContext> glContext;
diff --git a/gm/valgrind.supp b/gm/valgrind.supp
new file mode 100644
index 0000000..f13fa69
--- /dev/null
+++ b/gm/valgrind.supp
@@ -0,0 +1,16 @@
+# Pass this file to Valgrind with "--suppressions=gm/valgrind.supp"
+# to avoid reporting errors inside the driver.
+
+{
+ nVidiaDriverUninitializedJump001
+ Memcheck:Cond
+ obj:/usr/lib/nvidia-current/libnvidia-glcore.so.280.13
+}
+{
+ nVidiaDriverLeak001
+ Memcheck:Leak
+ fun:malloc
+ obj:/usr/lib/nvidia-current/libGL.so.280.13
+}
+
+