From 9b777deb00fb50dba37ccc1ee69767c6e04a3ee4 Mon Sep 17 00:00:00 2001 From: weili Date: Fri, 19 Aug 2016 16:19:46 -0700 Subject: Fix an embedder test with leaked page object The public API FPDFPage_New() incorrectly said to use FPDFPage_Delete() instead of FPDF_ClosePage() to free the new page. This led to a page object leak in an embedder test. Correct the public API description as well as its usage in the embedder test. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2260683003 --- public/fpdf_edit.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index acec6c0d30..47fdf9e76e 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -38,13 +38,16 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument(); // Create a new PDF page. // // document - handle to document. -// page_index - the index of the page to create. +// page_index - suggested index of the page to create. If it is larger than +// document's current last index(L), the created page index is +// the next available index -- L+1. // width - the page width. // height - the page height. // // Returns the handle to the new page. // -// The page should be deleted with |FPDFPage_Delete| when finished. +// The page should be closed with CPDF_ClosePage() when finished as +// with any other page in the document. DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, double width, -- cgit v1.2.3