diff options
Diffstat (limited to 'profiler')
-rw-r--r-- | profiler/src/main.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index d21ae81d..27f15b78 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -575,12 +575,10 @@ static void DrawContents() #ifndef TRACY_NO_FILESELECTOR if( ImGui::Button( ICON_FA_FOLDER_OPEN " Open saved trace" ) && !loadThread.joinable() ) { - auto fn = tracy::Fileselector::OpenFile( "tracy", "Tracy Profiler trace file" ); - if( !fn.empty() ) - { + tracy::Fileselector::OpenFile( "tracy", "Tracy Profiler trace file", []( const char* fn ) { try { - auto f = std::shared_ptr<tracy::FileRead>( tracy::FileRead::Open( fn.c_str() ) ); + auto f = std::shared_ptr<tracy::FileRead>( tracy::FileRead::Open( fn ) ); if( f ) { loadThread = std::thread( [f] { @@ -609,7 +607,7 @@ static void DrawContents() { badVer.state = tracy::BadVersionState::ReadError; } - } + } ); } if( badVer.state != tracy::BadVersionState::Ok ) |