Skip to content

Commit

Permalink
fix:add debug log to locate the crash reason
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Feb 12, 2025
1 parent e083c28 commit b376f95
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/wordfinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ void WordFinder::cancel()

void WordFinder::clear()
{
qDebug()<<"WordFinder::cancel() begin";
cancel();
queuedRequests.clear();
qDebug()<<"WordFinder::cancel() finished";
finishedRequests.clear();
qDebug()<<"finishedRequests::clear() finished";
}

void WordFinder::requestFinished()
Expand Down Expand Up @@ -493,7 +495,13 @@ void WordFinder::updateResults()

void WordFinder::cancelSearches()
{
for ( auto & queuedRequest : queuedRequests ) {
queuedRequest->cancel();
try {
for ( auto & queuedRequest : queuedRequests ) {
queuedRequest->cancel();
}
}
catch ( std::exception & e ) {
qDebug() << "cancelSearches() error:" << e.what();
}
queuedRequests.clear();
}

0 comments on commit b376f95

Please sign in to comment.