16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

throw bad alloc on opengl oom

This commit is contained in:
milek7
2018-08-03 22:38:23 +02:00
parent af0e193bde
commit f0b4f42128
3 changed files with 3 additions and 7 deletions

View File

@@ -36,12 +36,12 @@ int main( int argc, char *argv[] )
result = Application.run();
}
Application.exit();
std::_Exit(0); // skip destructors, there are ordering errors which causes segfaults
return result;
}
catch( std::bad_alloc const &Error )
{
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
return -1;
}
LogsFlush();
std::_Exit(0); // skip destructors, there are ordering errors which causes segfaults
}

View File

@@ -298,8 +298,6 @@ eu07_application::run()
Timer::subsystem.mainloop_total.stop();
}
LogsFlush();
return 0;
}

View File

@@ -276,10 +276,8 @@ void opengl_vbogeometrybank::setup_buffer()
glBindBuffer(GL_ARRAY_BUFFER, 0);
if( ::glGetError() == GL_OUT_OF_MEMORY ) {
// TBD: throw a bad_alloc?
ErrorLog( "openGL error: out of memory; failed to create a geometry buffer" );
delete_buffer();
return;
throw std::bad_alloc();
}
m_buffercapacity = datasize;
}