Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: experimental/skpdiff/SkCLImageDiffer.cpp

Issue 18051004: fix OpenCL memory leak (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698