Skip to content

Commit

Permalink
catch bad_alloc exception when filling the attribute table
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7701 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Dec 1, 2007
1 parent b0c3d68 commit af5f888
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/legend/qgslegendlayerfile.cpp
Expand Up @@ -260,7 +260,14 @@ void QgsLegendLayerFile::table()
}

mTableDisplay = new QgsAttributeTableDisplay(vlayer, app);
mTableDisplay->table()->fillTable(vlayer);
try
{
mTableDisplay->table()->fillTable(vlayer);
}
catch(std::bad_alloc& ba)
{
QMessageBox::critical(0, tr("bad_alloc exception"), tr("Filling the attribute table has been stopped because there was no more virtual memory left"));
}
mTableDisplay->table()->setSorting(true);

connect(mTableDisplay, SIGNAL(deleted()), this, SLOT(invalidateTableDisplay()));
Expand Down

0 comments on commit af5f888

Please sign in to comment.