Fixes #15455. Must call OpenWalletActivity::open asynchronously only after all connections are made to the OpenWalletActivity instance, otherwise signals can be missed.
gui: Fix async open wallet call order #15462
pull promag wants to merge 1 commits into bitcoin:master from promag:2019-02-fix-15455 changing 2 files +2 −1-
promag commented at 3:49 PM on February 22, 2019: member
-
in src/qt/bitcoingui.cpp:399 in 01e25ff6ad outdated
395 | @@ -396,6 +396,7 @@ void BitcoinGUI::createActions() 396 | connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet); 397 | connect(activity, &OpenWalletActivity::finished, activity, &QObject::deleteLater); 398 | connect(activity, &OpenWalletActivity::finished, dialog, &QObject::deleteLater); 399 | + QMetaObject::invokeMethod(activity, "open");
promag commented at 3:51 PM on February 22, 2019:Note, removed the unnecessary explicit
Qt::QueuedConnectionargument. The defaultQt::AutoConnectionis enough since the activity thread is not the current thread.
Sjors commented at 9:03 AM on February 23, 2019:Nit: check the return bool, and maybe write a log message if this is false, or abort.
promag commented at 9:34 AM on February 23, 2019:Thanks, done.
MarcoFalke added the label GUI on Feb 22, 2019MarcoFalke added this to the milestone 0.18.0 on Feb 22, 2019DrahtBot commented at 6:38 PM on February 22, 2019: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #15478 (wip: gui: Refactor open wallet activity by promag)
- #15204 (gui: Add Open External Wallet action by promag)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Sjors approvedSjors commented at 9:10 AM on February 23, 2019: membertACK 01e25ff6ad
gui: Fix async open wallet call order a720a98301promag force-pushed on Feb 23, 2019in src/qt/bitcoingui.cpp:400 in a720a98301
395 | @@ -396,6 +396,8 @@ void BitcoinGUI::createActions() 396 | connect(activity, &OpenWalletActivity::opened, this, &BitcoinGUI::setCurrentWallet); 397 | connect(activity, &OpenWalletActivity::finished, activity, &QObject::deleteLater); 398 | connect(activity, &OpenWalletActivity::finished, dialog, &QObject::deleteLater); 399 | + bool invoked = QMetaObject::invokeMethod(activity, "open"); 400 | + assert(invoked);
laanwj commented at 10:32 AM on February 27, 2019:When can this fail?
promag commented at 10:37 AM on February 27, 2019:If the slot is renamed it would still compile. With Qt 5.10 it is possible to invoke like
QMetaObject::invokeMethod(activity, &OpenWalletActivity::open).
laanwj commented at 10:53 AM on February 27, 2019:Thanks! (I think an assertion is in-order then, if only a compile-time bug can trigger it)
laanwj commented at 10:36 AM on February 27, 2019: memberutACK a720a983015c9ef8cc814c16a5b9ef6379695817
laanwj merged this on Feb 27, 2019laanwj closed this on Feb 27, 2019laanwj referenced this in commit 6f43ed4c5a on Feb 27, 2019deadalnix referenced this in commit 1eab626b5c on May 21, 2020PastaPastaPasta referenced this in commit d90e81919f on Oct 25, 2021pravblockc referenced this in commit b47d70de1c on Nov 18, 2021MarcoFalke locked this on Dec 16, 2021LabelsMilestone
0.18.0
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC
More mirrored repositories can be found on mirror.b10c.me