Skip to content

Commit

Permalink
Fix for ticket #101.
Browse files Browse the repository at this point in the history
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 90ed5b6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/composer/qgscomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 90ed5b6

Please sign in to comment.