mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +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();
|
result = Application.run();
|
||||||
}
|
}
|
||||||
Application.exit();
|
Application.exit();
|
||||||
std::_Exit(0); // skip destructors, there are ordering errors which causes segfaults
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
catch( std::bad_alloc const &Error )
|
catch( std::bad_alloc const &Error )
|
||||||
{
|
{
|
||||||
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
|
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();
|
Timer::subsystem.mainloop_total.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
LogsFlush();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -276,10 +276,8 @@ void opengl_vbogeometrybank::setup_buffer()
|
|||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
|
||||||
if( ::glGetError() == GL_OUT_OF_MEMORY ) {
|
if( ::glGetError() == GL_OUT_OF_MEMORY ) {
|
||||||
// TBD: throw a bad_alloc?
|
|
||||||
ErrorLog( "openGL error: out of memory; failed to create a geometry buffer" );
|
ErrorLog( "openGL error: out of memory; failed to create a geometry buffer" );
|
||||||
delete_buffer();
|
throw std::bad_alloc();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
m_buffercapacity = datasize;
|
m_buffercapacity = datasize;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user