Skip to content

Commit af5f888

Browse files
author
mhugent
committedDec 1, 2007
catch bad_alloc exception when filling the attribute table
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7701 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b0c3d68 commit af5f888

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/app/legend/qgslegendlayerfile.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,14 @@ void QgsLegendLayerFile::table()
260260
}
261261

262262
mTableDisplay = new QgsAttributeTableDisplay(vlayer, app);
263-
mTableDisplay->table()->fillTable(vlayer);
263+
try
264+
{
265+
mTableDisplay->table()->fillTable(vlayer);
266+
}
267+
catch(std::bad_alloc& ba)
268+
{
269+
QMessageBox::critical(0, tr("bad_alloc exception"), tr("Filling the attribute table has been stopped because there was no more virtual memory left"));
270+
}
264271
mTableDisplay->table()->setSorting(true);
265272

266273
connect(mTableDisplay, SIGNAL(deleted()), this, SLOT(invalidateTableDisplay()));

0 commit comments

Comments
 (0)