Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Library: don't crash at exit after a folder or a comic is deleted#203

Merged
luisangelsm merged 2 commits intoYACReader:developfrom
vedgy:fix-library-crash-at-exit-after-deletion
Jun 19, 2021
Merged

Library: don't crash at exit after a folder or a comic is deleted#203
luisangelsm merged 2 commits intoYACReader:developfrom
vedgy:fix-library-crash-at-exit-after-deletion

Conversation

@vedgy
Copy link
Contributor

@vedgy vedgy commented Feb 7, 2021

See the commit messages for details.

vedgy added 2 commits February 7, 2021 19:46
finished() signal of both FoldersRemover and ComicsRemover was not
connected to their QThread's quit() slot. So the thread kept running
after the deletion completed. The QThread's parent is LibraryWindow.
Thus LibraryWindow's ~QObject() invokes the QThread's destructor.

As a result, when the user exited YACReader Library after deleting at
least one folder or comic, it printed the following FATAL message and
crashed at exit: "QThread: Destroyed while thread is still running".

Extract signal-slot connections between a remover and a QThread into
moveAndConnectRemoverToThread() to reduce code duplication.

Remove always true (thread != NULL) checks.
QSqlDatabase::commit() in ComicModel::finishTransaction() returned false
(failed) when this slot was invoked the second time in a row.
@luisangelsm luisangelsm merged commit 85677af into YACReader:develop Jun 19, 2021
@vedgy vedgy deleted the fix-library-crash-at-exit-after-deletion branch June 19, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants