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

Side by Side Diff: xfa/fde/css/fde_cssstyleselector.h

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | xfa/fde/css/fde_cssstyleselector.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ 7 #ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
8 #define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ 8 #define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 : m_dwRefCount(1), m_pAllocator(pAlloc) {} 391 : m_dwRefCount(1), m_pAllocator(pAlloc) {}
392 392
393 ~CFDE_CSSComputedStyle() {} 393 ~CFDE_CSSComputedStyle() {}
394 394
395 // IFX_Unknown: 395 // IFX_Unknown:
396 uint32_t AddRef() override { return ++m_dwRefCount; } 396 uint32_t AddRef() override { return ++m_dwRefCount; }
397 397
398 uint32_t Release() override { 398 uint32_t Release() override {
399 uint32_t dwRefCount = --m_dwRefCount; 399 uint32_t dwRefCount = --m_dwRefCount;
400 if (dwRefCount == 0) { 400 if (dwRefCount == 0) {
401 if (m_NonInheritedData.m_pCounterStyle) 401 delete m_NonInheritedData.m_pCounterStyle;
402 delete m_NonInheritedData.m_pCounterStyle;
403
404 FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this); 402 FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this);
405 } 403 }
406 return dwRefCount; 404 return dwRefCount;
407 } 405 }
408 406
409 // IFDE_CSSComputedStyle: 407 // IFDE_CSSComputedStyle:
410 void Reset() override { 408 void Reset() override {
411 m_InheritedData.Reset(); 409 m_InheritedData.Reset();
412 m_NonInheritedData.Reset(); 410 m_NonInheritedData.Reset();
413 } 411 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 } 580 }
583 581
584 uint32_t m_dwRefCount; 582 uint32_t m_dwRefCount;
585 IFX_MEMAllocator* m_pAllocator; 583 IFX_MEMAllocator* m_pAllocator;
586 CFDE_CSSInheritedData m_InheritedData; 584 CFDE_CSSInheritedData m_InheritedData;
587 CFDE_CSSNonInheritedData m_NonInheritedData; 585 CFDE_CSSNonInheritedData m_NonInheritedData;
588 CFX_WideStringArray m_CustomProperties; 586 CFX_WideStringArray m_CustomProperties;
589 }; 587 };
590 588
591 #endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ 589 #endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
OLDNEW
« no previous file with comments | « no previous file | xfa/fde/css/fde_cssstyleselector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698