forked from 0ad/0ad
now catches bad_alloc exceptions thrown during reloads (=> no need to wrap new in exception handler there)
This was SVN commit r558.
This commit is contained in:
parent
0eeca662cc
commit
2299573567
@ -467,7 +467,16 @@ if(!(flags & RES_KEY))
|
||||
|
||||
if(vtbl->reload)
|
||||
{
|
||||
err = vtbl->reload(hd->user, fn);
|
||||
// catch exception to simplify reload funcs - let them use new()
|
||||
try
|
||||
{
|
||||
err = vtbl->reload(hd->user, fn);
|
||||
}
|
||||
catch(std::bad_alloc)
|
||||
{
|
||||
err = ERR_NO_MEM;
|
||||
}
|
||||
|
||||
if(err < 0)
|
||||
{
|
||||
h_free(h, type);
|
||||
|
Loading…
Reference in New Issue
Block a user