Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/source/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2610,7 +2610,7 @@ bool MainWindow::handleArguments_Open(const QStringList &listParam)
if (UiTools::isWayland() && firstLoad) {
firstLoad = false;
auto path = listParam[0];
QTimer::singleShot(200, [this, &path]() {
QTimer::singleShot(200, [this, path]() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Use a QObject context or a safe pointer instead of capturing this in a delayed lambda to avoid potential use-after-free.

Because this runs 200 ms later without a QObject context, this may already be destroyed (e.g., if the window closes quickly), leading to a use-after-free in loadArchive(path). Please use the QTimer::singleShot overload that takes a QObject context, or capture a QPointer<MainWindow> and check it before calling loadArchive.

loadArchive(path);
});
} else {
Expand Down
Loading