mirror of
https://github.com/mpv-player/mpv
synced 2025-02-06 15:11:58 +00:00
client API: qtexample: don't pass deallocated strings to mpv
The temporary QByteArray is deallocated already at the end of the statement in C++, instead of the end of the scope (like in C).
This commit is contained in:
parent
1483fd443a
commit
483595e2d4
@ -114,7 +114,8 @@ void MainWindow::on_file_open()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, "Open file");
|
||||
if (mpv) {
|
||||
const char *args[] = {"loadfile", filename.toUtf8().data(), NULL};
|
||||
const QByteArray c_filename = filename.toUtf8();
|
||||
const char *args[] = {"loadfile", c_filename.data(), NULL};
|
||||
mpv_command_async(mpv, 0, args);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user