Skip to content

Commit af4939f

Browse files
authored
fix export crash on some configurations (#5364)
1 parent 20e57b1 commit af4939f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/MRCommonPlugins/ViewerButtons/MRIOFilesMenuItems.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ bool SaveObjectMenuItem::action()
640640
| IOFilters( baseFilters.begin() + firstFilterNum + 1, baseFilters.end() );
641641
}
642642

643+
auto name = objs[0]->name(); // won't be able to get after moving objs into callback
643644
saveFileDialogAsync( [objs = std::move( objs ), objType, settingsManager] ( const std::filesystem::path& savePath0 ) mutable
644645
{
645646
if ( savePath0.empty() )
@@ -690,7 +691,7 @@ bool SaveObjectMenuItem::action()
690691
};
691692
} );
692693
}, {
693-
.fileName = objs[0]->name(),
694+
.fileName = std::move( name ),
694695
.filters = std::move( filters ),
695696
} );
696697
return false;

0 commit comments

Comments
 (0)