diff options
author | Lei Zhang <thestig@chromium.org> | 2015-07-16 18:45:22 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-07-16 18:45:22 -0700 |
commit | 796c908e7b7bdde819a1e5a4bfd3576d8e8859d6 (patch) | |
tree | 8c0cd763dd9bf70bc14da8f8cb7893835a3572fe /fpdfsdk/src/fpdftext.cpp | |
parent | ba026913c273a5c1c841bced288fdab03f10ad08 (diff) | |
download | pdfium-796c908e7b7bdde819a1e5a4bfd3576d8e8859d6.tar.xz |
Merge to XFA: Cleanup: Do not check pointers before deleting them, part 2.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1195363002 .
(cherry picked from commit 21bf242a31eff79f754c5e9c3b41c52e33483bb0)
Review URL: https://codereview.chromium.org/1235753006 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r-- | fpdfsdk/src/fpdftext.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp index acfc79238a..7b07a13890 100644 --- a/fpdfsdk/src/fpdftext.cpp +++ b/fpdfsdk/src/fpdftext.cpp @@ -32,11 +32,7 @@ DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) } DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) { - if (text_page){ - IPDF_TextPage* textpage=(IPDF_TextPage*)text_page; - delete textpage; - text_page=NULL; - } + delete (IPDF_TextPage*)text_page; } DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) { @@ -252,9 +248,6 @@ DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,int link_index, } DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) { - if (!link_page) return; - IPDF_LinkExtract* pageLink=(IPDF_LinkExtract*)link_page; - delete pageLink; - pageLink =NULL; + delete (IPDF_LinkExtract*)link_page; } |