Skip to content

Commit 380adbd

Browse files
author
g_j_m
committed
Fix for ticket #101.
A temporary fix that prevents a qgis crash due to running out of memory. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5375 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4b054e4 commit 380adbd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/composer/qgscomposition.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,20 @@ void QgsComposition::paperSizeChanged ( void )
568568
setOptions();
569569
}
570570

571-
recalculate();
571+
try
572+
{
573+
recalculate();
574+
}
575+
catch (std::bad_alloc& ba)
576+
{
577+
// A better solution here would be to set the canvas back to the
578+
// original size and carry on, but for the moment this will
579+
// prevent a crash due to an uncaught exception.
580+
QMessageBox::critical( 0, tr("Out of memory"),
581+
tr("Qgis is unable to resize the paper size due to "
582+
"insufficient memory.\n It is best that you avoid "
583+
"using the map composer until you restart qgis.\n") );
584+
}
572585

573586
mView->repaintContents();
574587
writeSettings();

0 commit comments

Comments
 (0)