Skip to content
Permalink
Browse files
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@5375 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Apr 25, 2006
1 parent cd5105c commit 90ed5b61f91d49d2e5866c31fcc5269860b6346b
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/composer/qgscomposition.cpp
@@ -568,7 +568,20 @@ void QgsComposition::paperSizeChanged ( void )
setOptions();
}

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

mView->repaintContents();
writeSettings();

0 comments on commit 90ed5b6

Please sign in to comment.