gsdx: Catch bad_alloc exceptions

This commit is contained in:
Jonathan Li 2016-11-09 22:41:02 +00:00
parent ae6f26f3ef
commit 1530effb29
1 changed files with 20 additions and 0 deletions

View File

@ -646,6 +646,10 @@ EXPORT_C GSinitReadFIFO(uint8* mem)
catch (GSDXRecoverableError)
{
}
catch (const std::bad_alloc&)
{
fprintf(stderr, "GSdx: Memory allocation error\n");
}
}
EXPORT_C GSreadFIFO(uint8* mem)
@ -657,6 +661,10 @@ EXPORT_C GSreadFIFO(uint8* mem)
catch (GSDXRecoverableError)
{
}
catch (const std::bad_alloc&)
{
fprintf(stderr, "GSdx: Memory allocation error\n");
}
}
EXPORT_C GSinitReadFIFO2(uint8* mem, uint32 size)
@ -669,6 +677,10 @@ EXPORT_C GSinitReadFIFO2(uint8* mem, uint32 size)
catch (GSDXRecoverableError)
{
}
catch (const std::bad_alloc&)
{
fprintf(stderr, "GSdx: Memory allocation error\n");
}
}
EXPORT_C GSreadFIFO2(uint8* mem, uint32 size)
@ -680,6 +692,10 @@ EXPORT_C GSreadFIFO2(uint8* mem, uint32 size)
catch (GSDXRecoverableError)
{
}
catch (const std::bad_alloc&)
{
fprintf(stderr, "GSdx: Memory allocation error\n");
}
}
EXPORT_C GSgifTransfer(const uint8* mem, uint32 size)
@ -752,6 +768,10 @@ EXPORT_C GSvsync(int field)
catch (GSDXRecoverableError)
{
}
catch (const std::bad_alloc&)
{
fprintf(stderr, "GSdx: Memory allocation error\n");
}
}
EXPORT_C_(uint32) GSmakeSnapshot(char* path)