From 1a1d7648d3e338b756e464cebb2ae1a815359afa Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 6 Dec 2016 06:29:28 -0800 Subject: Return unique_ptrs from CFX_DIBitmap::Clone(). Because that's what clone does. Perform immediate release in some spots to avoid disrupting too much at once. Review-Url: https://codereview.chromium.org/2534953004 --- xfa/fxbarcode/BC_TwoDimWriter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fxbarcode/BC_TwoDimWriter.cpp') diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp index 83b7b3c081..ec6c3626b2 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp @@ -82,9 +82,10 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, } } if (!m_bFixedSize) { - CFX_DIBitmap* pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height); + std::unique_ptr pStretchBitmap = + pOutBitmap->StretchTo(m_Width, m_Height); delete pOutBitmap; - pOutBitmap = pStretchBitmap; + pOutBitmap = pStretchBitmap.release(); } } -- cgit v1.2.3