Skip to content

Commit

Permalink
Fix lifetime issue with utf8 string in Drumkit::exportTo (#2069)
Browse files Browse the repository at this point in the history
  • Loading branch information
cme authored Nov 24, 2024
1 parent 9ff9f3a commit f3f5428
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Basics/Drumkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,8 @@ bool Drumkit::exportTo( const QString& sTargetDir, bool* pUtf8Encoded,
const auto targetPath = sTargetNamePadded.toStdWString();
nRet = archive_write_open_filename_w( a, targetPath.c_str() );
#else
const auto targetPath = sTargetName.toUtf8().constData();
const auto targetPathUtf8 = sTargetName.toUtf8();
const auto targetPath = targetPathUtf8.constData();
nRet = archive_write_open_filename( a, targetPath );
#endif
if ( nRet != ARCHIVE_OK ) {
Expand Down

0 comments on commit f3f5428

Please sign in to comment.