Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: xfa/fxbarcode/BC_TwoDimWriter.cpp

Issue 2534953004: Return unique_ptrs from CFX_DIBitmap::Clone(). (Closed)
Patch Set: win again Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fxbarcode/BC_TwoDimWriter.cpp
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp
index 83b7b3c0816bab4c5ffc7b667237c701cefed4d9..ec6c3626b2a574a84fc3f8323692937e21e8b31f 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<CFX_DIBitmap> pStretchBitmap =
+ pOutBitmap->StretchTo(m_Width, m_Height);
delete pOutBitmap;
- pOutBitmap = pStretchBitmap;
+ pOutBitmap = pStretchBitmap.release();
dsinclair 2016/12/05 20:41:26 can pOutBitmap be a unique_ptr& instead of a *&?
Tom Sepez 2016/12/05 21:38:13 Yes, but it ripples through a lot of places so I l
}
}

Powered by Google App Engine
This is Rietveld 408576698