Skip to content

Conversation

metsma
Copy link
Contributor

@metsma metsma commented Aug 29, 2025

Fixes #346

Signed-off-by: Raul Metsma raul@metsma.ee

@metsma metsma force-pushed the thread branch 9 times, most recently from a6f2233 to 2911ccf Compare September 1, 2025 19:08
Copy link
Member

@mrts mrts left a comment

Choose a reason for hiding this comment

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

Thanks, very nice simplification of the thread management 👍 !

@metsma metsma force-pushed the thread branch 3 times, most recently from 3f0e6c7 to d9aa4d1 Compare September 3, 2025 07:10
@metsma metsma force-pushed the thread branch 8 times, most recently from ba65333 to 893a5ad Compare September 24, 2025 11:28
@metsma metsma force-pushed the thread branch 3 times, most recently from 085c22a to 6f6b023 Compare October 1, 2025 09:21
Fixes #346

Signed-off-by: Raul Metsma <raul@metsma.ee>
ControllerChildThread::waitForControllerNotify.wakeAll();
while (thread->isRunning()) {
using namespace std::chrono_literals;
thread->wait(100ms);
Copy link
Member

Choose a reason for hiding this comment

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

The 100 millisecond wait made only sense along with event processing, recommend to add it back:

Suggested change
thread->wait(100ms);
thread->wait(100ms);
QCoreApplication::processEvents();

Otherwise the while loop does not have a purpose, it is equivalent to just waiting indefinitely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All calls waitForChildThreads() are after disposeUI, no point to process any more events.
and timer makes sure that function does not continue before all thread are ended

void Controller::onDialogCancel()
{
REQUIRE_NON_NULL(window)

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't you emit stopCardEventMonitorThread() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not see that there can be any running thread at this point

{
static MockUI instance;
return &instance;
return new MockUI;
Copy link
Member

Choose a reason for hiding this comment

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

This leaks, no parent nor WA_DeleteOnClose. Should you add WA_DeleteOnClose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think it will ever shown and cosed. Right now there is double free crash

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.

bug: crash in pinpad code
2 participants