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

Unified Diff: core/fpdfapi/page/cpdf_image.cpp

Issue 2384883003: Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: nits Created 4 years, 2 months 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: core/fpdfapi/page/cpdf_image.cpp
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index ae962e8b98ecb12afaf356e3f0f03e7e337420c8..0334c1e9c9774088185c1f3c6f9a9efd88170730 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -55,10 +55,8 @@ CPDF_Image::CPDF_Image(CPDF_Document* pDoc, CPDF_Stream* pStream, bool bInline)
CPDF_Image::~CPDF_Image() {
if (m_bInline) {
- if (m_pStream)
- m_pStream->Release();
- if (m_pInlineDict)
- m_pInlineDict->Release();
+ delete m_pStream;
+ delete m_pInlineDict;
}
}
@@ -288,10 +286,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
pNewBitmap->Copy(pBitmap);
pNewBitmap->ConvertFormat(FXDIB_Rgb);
SetImage(pNewBitmap, iCompress);
- if (pDict) {
- pDict->Release();
- pDict = nullptr;
- }
+ delete pDict;
+ pDict = nullptr;
FX_Free(dest_buf);
dest_buf = nullptr;
dest_size = 0;

Powered by Google App Engine
This is Rietveld 408576698