B2018-099: Print all & Approve all of large set crashes with out of memory error
This commit is contained in:
@@ -75,10 +75,17 @@ namespace VEPROMS
|
||||
get { return _OnlyShowContinuousActionSummary; }
|
||||
set { _OnlyShowContinuousActionSummary = value; }
|
||||
}
|
||||
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd,string pdfFile, Point newLocation,bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, bool removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer)
|
||||
private bool _DidAll = false;
|
||||
public bool DidAll
|
||||
{
|
||||
get { return _DidAll; }
|
||||
set { _DidAll = value; }
|
||||
}
|
||||
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd,string pdfFile, Point newLocation,bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, bool removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll)
|
||||
{
|
||||
Prefix = prefix;
|
||||
OpenPDF = openPDF;
|
||||
DidAll = didAll;
|
||||
InitializeComponent();
|
||||
// if the version number of PROMS is 1.0, then we are running a Demo version.
|
||||
// When running a Demo version, force a "Sample" watermark when printing.
|
||||
@@ -166,8 +173,25 @@ namespace VEPROMS
|
||||
do
|
||||
{
|
||||
int profileDepth = ProfileTimer.Push(">>>> MyPromsPrinter.Print");
|
||||
// B2018-099: remove cache items for contents, items and parts to prevent out of memory errors when
|
||||
// doing print all or automated print testing or approval of some or all procedures, i.e. HashSet and use of them below.
|
||||
HashSet<int> cacheContentInfo = null;
|
||||
HashSet<int> cacheItemInfo = null;
|
||||
HashSet<int> cachePartInfo = null;
|
||||
if (DidAll)
|
||||
{
|
||||
cacheContentInfo = ContentInfo.CacheList;
|
||||
cacheItemInfo = ItemInfo.CacheList;
|
||||
cachePartInfo = PartInfo.CacheList;
|
||||
}
|
||||
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary);
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
if (DidAll)
|
||||
{
|
||||
ContentInfo.RestoreCacheList(cacheContentInfo);
|
||||
ItemInfo.RestoreCacheList(cacheItemInfo);
|
||||
PartInfo.RestoreCacheList(cachePartInfo);
|
||||
}
|
||||
}
|
||||
while (_PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
if (_PdfFile == null)
|
||||
|
Reference in New Issue
Block a user