[VisualDeckStorage] Guard against widget deletion during tag edit dialog (#7674)

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
This commit is contained in:
sentry[bot] 2026-10-27 09:14:52 +01:00 • committed by GitHub
parent aa42cfbccc
commit 92d082e735
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,7 @@
#include <QDialog>
#include <QDir>
#include <QPointer>
#include <QDirIterator>
#include <QHBoxLayout>
#include <QSizePolicy>
@ -117,8 +118,13 @@ void DeckPreviewDeckTagsDisplayWidget::openTagEditDlg()
void DeckPreviewDeckTagsDisplayWidget::execTagDialog(const QStringList &knownTags)
{
QPointer<DeckPreviewDeckTagsDisplayWidget> self(this);
DeckPreviewTagDialog dialog(knownTags, currentTags);
if (dialog.exec() == QDialog::Accepted) {
// Guard against the widget being destroyed during dialog.exec()'s nested event loop.
if (!self) {
return;
}
QStringList updatedTags = dialog.getActiveTags();
if (updatedTags != currentTags) {
setTags(updatedTags);