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/qgis@5375 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Apr 25, 2006
1 parent 4b054e4 commit 380adbde03e58968da9fd6392465b731991a86e6
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 380adbd

Please sign in to comment.