Catch memory exhaustion trying to import large DXFs
See https://gitlab.com/kicad/code/kicad/-/issues/11308
(cherry picked from commit 9f8c0a8185
)
This commit is contained in:
parent
6706a5c462
commit
d5de4bb5c7
|
@ -118,7 +118,15 @@ DXF_IMPORT_PLUGIN::~DXF_IMPORT_PLUGIN()
|
|||
|
||||
bool DXF_IMPORT_PLUGIN::Load( const wxString& aFileName )
|
||||
{
|
||||
try
|
||||
{
|
||||
return ImportDxfFile( aFileName );
|
||||
}
|
||||
catch( const std::bad_alloc& )
|
||||
{
|
||||
reportMsg( _( "Memory was exhausted trying to load the DXF, it may be too large." ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue