Bug 860395 - Delete SharedImage object in ImageBridgeCopyAndSendTask::Run() to prevent leak. r=nical, a=tef+
authorMike Habicher <mikeh@mozilla.com>
Wed, 10 Apr 2013 12:37:49 -0400
changeset 118725 389e5dd939c066050209a3801e2fbd4f8c6c714a
parent 118724 d91afcc29b9101059a41bbec36a81e84cfe6b987
child 118726 f83d169babee1c1d3d506c65b43450fbf750518d
push id99
push userryanvm@gmail.com
push dateThu, 11 Apr 2013 12:04:56 +0000
reviewersnical, tef
bugs860395
milestone18.0
Bug 860395 - Delete SharedImage object in ImageBridgeCopyAndSendTask::Run() to prevent leak. r=nical, a=tef+
gfx/layers/ipc/ImageContainerChild.cpp
--- a/gfx/layers/ipc/ImageContainerChild.cpp
+++ b/gfx/layers/ipc/ImageContainerChild.cpp
@@ -324,16 +324,17 @@ public:
   : mChild(child), mImageContainer(aContainer), mImage(aImage) {}
 
   void Run()
   { 
     SharedImage* img = mChild->ImageToSharedImage(mImage.get());
     if (img) {
       mChild->SendPublishImage(*img);
     }
+    delete img;
   }
 
   ImageContainerChild *mChild;
   nsRefPtr<ImageContainer> mImageContainer;
   nsRefPtr<Image> mImage;
 };
 
 SharedImage* ImageContainerChild::ImageToSharedImage(Image* aImage)