Index: experimental/skpdiff/SkCLImageDiffer.cpp |
diff --git a/experimental/skpdiff/SkCLImageDiffer.cpp b/experimental/skpdiff/SkCLImageDiffer.cpp |
index 721f4c4d985ee86b0eefa90a902ff5a2c4f7724c..50eb2b6fc8f4a0befaff8c6a6dcae7b108cc1230 100644 |
--- a/experimental/skpdiff/SkCLImageDiffer.cpp |
+++ b/experimental/skpdiff/SkCLImageDiffer.cpp |
@@ -187,6 +187,12 @@ int SkDifferentPixelsImageDiffer::queueDiff(SkBitmap * baseline, SkBitmap * test |
clEnqueueReadBuffer(fCommandQueue, diff->resultsBuffer, CL_TRUE, 0, sizeof(int), &numDiffPixels, 0, NULL, NULL); |
diff->result *= (double)numDiffPixels; |
diff->result = (1.0 - diff->result); |
+ |
+ // Release all the buffers created |
+ clReleaseMemObject(diff->resultsBuffer); |
+ clReleaseMemObject(diff->baseline); |
+ clReleaseMemObject(diff->test); |
+ |
SkDebugf("Time: %f\n", (get_seconds() - startTime)); |
return diffID; |