Fixed memory leak in the merge pdf method.
This commit is contained in:
parent
e460eca472
commit
b82586bb82
|
@ -625,8 +625,10 @@ public final class AEnv
|
||||||
PdfContentByte cb = copy.getDirectContent();
|
PdfContentByte cb = copy.getDirectContent();
|
||||||
for (int i = 1; i <= pages; i++) {
|
for (int i = 1; i <= pages; i++) {
|
||||||
document.newPage();
|
document.newPage();
|
||||||
|
copy.newPage();
|
||||||
PdfImportedPage page = copy.getImportedPage(reader, i);
|
PdfImportedPage page = copy.getImportedPage(reader, i);
|
||||||
cb.addTemplate(page, 0, 0);
|
cb.addTemplate(page, 0, 0);
|
||||||
|
copy.releaseTemplate(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.close();
|
document.close();
|
||||||
|
|
Loading…
Reference in New Issue