Merge master.
authorCarl Hetherington <cth@carlh.net>
Sun, 22 Jun 2014 20:48:49 +0000 (21:48 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 22 Jun 2014 20:48:49 +0000 (21:48 +0100)
1  2 
ChangeLog
src/lib/image_proxy.cc

diff --combined ChangeLog
index c2439f80742ebb65e023a5420aa96f5215b04518,cd348ca76db227dfbb238a3bfb75ccc2e18e6221..2782b563e9eaf5a9178f257c7871fb8a46265932
+++ b/ChangeLog
@@@ -1,7 -1,7 +1,11 @@@
 +2014-03-07  Carl Hetherington  <cth@carlh.net>
 +
 +      * Add subtitle view.
 +
+ 2014-06-22  Carl Hetherington  <cth@carlh.net>
+       * Fix large memory leak with image sources.
  2014-06-21  Carl Hetherington  <cth@carlh.net>
  
        * Move email config into the KDM email page.
diff --combined src/lib/image_proxy.cc
index 1eb9c169c5c3b375d4677b61f6b19bdc58af71db,ba572c72733e9c636a37575ca5cc04d6c609891b..039b1113300937fde92b65a7cad3f69880f3cb6f
@@@ -18,8 -18,8 +18,8 @@@
  */
  
  #include <Magick++.h>
 -#include <libdcp/util.h>
 -#include <libdcp/raw_convert.h>
 +#include <dcp/util.h>
 +#include <dcp/raw_convert.h>
  #include "image_proxy.h"
  #include "image.h"
  #include "exceptions.h"
@@@ -51,7 -51,7 +51,7 @@@ RawImageProxy::RawImageProxy (shared_pt
  RawImageProxy::RawImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket, shared_ptr<Log> log)
        : ImageProxy (log)
  {
 -      libdcp::Size size (
 +      dcp::Size size (
                xml->number_child<int> ("Width"), xml->number_child<int> ("Height")
                );
  
@@@ -69,9 -69,9 +69,9 @@@ voi
  RawImageProxy::add_metadata (xmlpp::Node* node) const
  {
        node->add_child("Type")->add_child_text (N_("Raw"));
 -      node->add_child("Width")->add_child_text (libdcp::raw_convert<string> (_image->size().width));
 -      node->add_child("Height")->add_child_text (libdcp::raw_convert<string> (_image->size().height));
 -      node->add_child("PixelFormat")->add_child_text (libdcp::raw_convert<string> (_image->pixel_format ()));
 +      node->add_child("Width")->add_child_text (dcp::raw_convert<string> (_image->size().width));
 +      node->add_child("Height")->add_child_text (dcp::raw_convert<string> (_image->size().height));
 +      node->add_child("PixelFormat")->add_child_text (dcp::raw_convert<string> (_image->pixel_format ()));
  }
  
  void
@@@ -128,9 -128,10 +128,9 @@@ MagickImageProxy::image () cons
                throw DecodeError (_("Could not decode image file"));
        }
  
 +      dcp::Size size (magick_image->columns(), magick_image->rows());
        LOG_TIMING ("[%1] MagickImageProxy decode finished", boost::this_thread::get_id ());
  
 -      libdcp::Size size (magick_image->columns(), magick_image->rows());
 -
        _image.reset (new Image (PIX_FMT_RGB24, size, true));
  
        /* Write line-by-line here as _image must be aligned, and write() cannot be told about strides */
                p += _image->stride()[0];
        }
  
+       delete magick_image;
        LOG_TIMING ("[%1] MagickImageProxy completes decode and convert of %2 bytes", boost::this_thread::get_id(), _blob.length());
  
        return _image;