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 119036 70481b9a9db518c3f9c218b1d588c2b46e0983f6
parent 119035 e71a865ab86a08f930c4e836a530d6ab4bd46cf6
child 119037 7d1f5875b8af1b746750336f7dcf4cf39902ddac
push id654
push usermhabicher@mozilla.com
push dateWed, 10 Apr 2013 18:19:16 +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)