Fixed memory leak in the merge pdf method.

This commit is contained in:
Heng Sin Low 2011-02-07 18:13:58 +08:00
parent e460eca472
commit b82586bb82
1 changed files with 10 additions and 8 deletions

View File

@ -320,7 +320,7 @@ public final class AEnv
log.info("Window=" + WindowNo log.info("Window=" + WindowNo
+ ", AD_Table_ID=" + AD_Table_ID + "/" + Record_ID + ", AD_Table_ID=" + AD_Table_ID + "/" + Record_ID
+ ", Force=" + force); + ", Force=" + force);
String error = null; String error = null;
MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(Env.getCtx(), AD_Client_ID); MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(Env.getCtx(), AD_Client_ID);
error = Doc.postImmediate(ass, AD_Table_ID, Record_ID, force, null); error = Doc.postImmediate(ass, AD_Table_ID, Record_ID, force, null);
@ -422,7 +422,7 @@ public final class AEnv
String tableName = column.substring(0, p); String tableName = column.substring(0, p);
column = column.substring(column.indexOf(".")+1); column = column.substring(column.indexOf(".")+1);
zoomQuery.setZoomTableName(tableName); zoomQuery.setZoomTableName(tableName);
zoomQuery.setZoomColumnName(column); zoomQuery.setZoomColumnName(column);
} }
else else
{ {
@ -540,7 +540,7 @@ public final class AEnv
return false; return false;
} }
} }
/** /**
* @return boolean * @return boolean
*/ */
@ -558,12 +558,12 @@ public final class AEnv
} else if (userAgent.indexOf("AppleWebKit") >= 0) { } else if (userAgent.indexOf("AppleWebKit") >= 0) {
if (userAgent.indexOf("Chrome") >= 0 || userAgent.indexOf("Safari") >= 0) { if (userAgent.indexOf("Chrome") >= 0 || userAgent.indexOf("Safari") >= 0) {
supported = true; supported = true;
} }
} }
} }
return supported; return supported;
} }
/** /**
* @return true if user agent is internet explorer 7 or lower * @return true if user agent is internet explorer 7 or lower
*/ */
@ -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();
@ -696,7 +698,7 @@ public final class AEnv
return locale; return locale;
} }
/** /**
* Get title for dialog window * Get title for dialog window
* @param ctx * @param ctx