Convert all files on the master branch to unix line endings.
[pdfium.git] / samples / pdfium_test.cc
index be12614..0d76b63 100644 (file)
@@ -426,7 +426,7 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
 
   IPDF_JSPLATFORM platform_callbacks;
   memset(&platform_callbacks, '\0', sizeof(platform_callbacks));
-  platform_callbacks.version = 1;
+  platform_callbacks.version = 2;
   platform_callbacks.app_alert = ExampleAppAlert;
   platform_callbacks.Doc_gotoPage = ExampleDocGotoPage;
 
@@ -550,8 +550,8 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
   }
 
   FORM_DoDocumentAAction(form, FPDFDOC_AACTION_WC);
-  FPDF_CloseDocument(doc);
   FPDFDOC_ExitFormFillEnvironment(form);
+  FPDF_CloseDocument(doc);
   FPDFAvail_Destroy(pdf_avail);
 
   fprintf(stderr, "Rendered %d pages.\n", rendered_pages);
@@ -616,8 +616,6 @@ int main(int argc, const char* argv[]) {
     if (!file_contents)
       continue;
     RenderPdf(filename, file_contents, file_length, options);
-    while (v8::platform::PumpMessageLoop(platform, v8::Isolate::GetCurrent()))
-      continue;
     free(file_contents);
   }