Skip to content

Commit 33b2721

Browse files
author
mhugent
committed
catch bad_alloc exception when filling the attribute table
git-svn-id: http://svn.osgeo.org/qgis/trunk@7701 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0bd11fd commit 33b2721

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/app/legend/qgslegendlayerfile.cpp

+8-1
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)