mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-23 09:10:51 +00:00
Report unloadable trace files on the command line instead of crashing.
Version and integrity checks throw from the View constructor, which was outside the try/catch guarding the file open, so a bad argv trace terminated the process. Catch and report it there as well.
This commit is contained in:
@@ -407,7 +407,16 @@ int main( int argc, char** argv )
|
||||
EM_ASM( alert( UTF8ToString( $0 ) ), msg.c_str() );
|
||||
}
|
||||
#else
|
||||
view.store( std::make_shared<tracy::View>( RunOnMainThread, *initFileOpen, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback, s_achievements ), std::memory_order_release );
|
||||
try
|
||||
{
|
||||
view.store( std::make_shared<tracy::View>( RunOnMainThread, *initFileOpen, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback, s_achievements ), std::memory_order_release );
|
||||
}
|
||||
catch( const std::exception& e )
|
||||
{
|
||||
fprintf( stderr, "Cannot load trace file: %s\n", e.what() );
|
||||
initFileOpen.reset();
|
||||
_Exit( 1 );
|
||||
}
|
||||
#endif
|
||||
initFileOpen.reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user