Index: content/browser/renderer_host/compositing_iosurface_mac.mm |
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm |
index 84441ef2ca1f7dd9d7e5c9e13721a98a3e195053..890fd8356711683a73944c2e0a8b7bfbd5c5bd09 100644 |
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm |
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm |
@@ -865,11 +865,14 @@ void CompositingIOSurfaceMac::FinishCopy() { |
} |
glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); CHECK_GL_ERROR(); |
+ // Ref so they don't get deleted in CleanupResourcesForCopy. |
base::Callback<void(bool, const SkBitmap&)> callback = copy_context_.callback; |
+ SkBitmap out_buf = copy_context_.out_buf; |
+ |
CleanupResourcesForCopy(); |
CGLSetCurrentContext(0); |
- callback.Run(buf != NULL, copy_context_.out_buf); |
+ callback.Run(buf != NULL, out_buf); |
} |
void CompositingIOSurfaceMac::CleanupResourcesForCopy() { |