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:
4
EU07.cpp
4
EU07.cpp
@@ -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
|
||||
}
|
||||
|
||||
@@ -298,8 +298,6 @@ eu07_application::run()
|
||||
Timer::subsystem.mainloop_total.stop();
|
||||
}
|
||||
|
||||
LogsFlush();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user