mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 18:39:18 +02:00
flush fixes for e3d exporter
This commit is contained in:
28
EU07.cpp
28
EU07.cpp
@@ -37,22 +37,20 @@ int main(int argc, char *argv[])
|
|||||||
int flags = std::stoi(std::string(argv[4]));
|
int flags = std::stoi(std::string(argv[4]));
|
||||||
int dynamic = std::stoi(std::string(argv[5]));
|
int dynamic = std::stoi(std::string(argv[5]));
|
||||||
export_e3d_standalone(in, out, flags, dynamic);
|
export_e3d_standalone(in, out, flags, dynamic);
|
||||||
std::_Exit(0);
|
} else {
|
||||||
}
|
try {
|
||||||
|
auto result { Application.init( argc, argv ) };
|
||||||
try
|
if( result == 0 ) {
|
||||||
{
|
result = Application.run();
|
||||||
auto result { Application.init( argc, argv ) };
|
Application.exit();
|
||||||
if( result == 0 ) {
|
}
|
||||||
result = Application.run();
|
} catch( std::bad_alloc const &Error ) {
|
||||||
Application.exit();
|
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
|
||||||
}
|
}
|
||||||
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() ) );
|
|
||||||
}
|
}
|
||||||
|
#ifndef _WIN32
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
#endif
|
||||||
std::_Exit(0); // skip destructors, there are ordering errors which causes segfaults
|
std::_Exit(0); // skip destructors, there are ordering errors which causes segfaults
|
||||||
}
|
}
|
||||||
|
|||||||
2
Logs.cpp
2
Logs.cpp
@@ -83,8 +83,8 @@ void WriteLog( const char *str, logtype const Type ) {
|
|||||||
output.open( filename, std::ios::trunc );
|
output.open( filename, std::ios::trunc );
|
||||||
}
|
}
|
||||||
output << str << "\n";
|
output << str << "\n";
|
||||||
|
output.flush();
|
||||||
}
|
}
|
||||||
output.flush();
|
|
||||||
|
|
||||||
log_scrollback.emplace_back(std::string(str));
|
log_scrollback.emplace_back(std::string(str));
|
||||||
if (log_scrollback.size() > 200)
|
if (log_scrollback.size() > 200)
|
||||||
|
|||||||
Reference in New Issue
Block a user