Collect garbage only in gui mode.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-03-04 15:00:59 +02:00
parent 6e60171bf7
commit c8a5b4a618

View File

@ -4719,6 +4719,8 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
if (guiEnabled)
{ // No errors occurred
if (qApp->IsGUIMode())
{
/* Collect garbage only after successfully parse. This way wrongly accused items have one more time to restore
* a reference. */
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
@ -4726,6 +4728,7 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
#else
doc->GarbageCollector(true);
#endif
}
patternReadOnly = doc->IsReadOnly();
SetEnableWidgets(true);