qt: Fix OpenWalletActivity::open() #18883

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:200505-fix-win changing 2 files +2 −2
  1. hebasto commented at 8:54 AM on May 5, 2020: member

    Fix #18835, I hope :)

  2. qt: Fix OpenWalletActivity::open() a6b7248949
  3. hebasto cross-referenced this on May 5, 2020 from issue debug assert in walletcontroller.cpp in func getOrCreateWallet, if thread is not gui by tarboss
  4. fanquake added the label GUI on May 5, 2020
  5. in src/qt/walletcontroller.cpp:311 in a6b7248949
     307 | @@ -308,6 +308,6 @@ void OpenWalletActivity::open(const std::string& path)
     308 |  
     309 |          if (wallet) m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(wallet));
     310 |  
     311 | -        QTimer::singleShot(0, this, &OpenWalletActivity::finish);
     312 | +        QMetaObject::invokeMethod(this, "finish", Qt::QueuedConnection);
    


    promag commented at 9:48 AM on May 5, 2020:

    What is the idea? AFAIK singleShot does a queued connection too.


    hebasto commented at 9:52 AM on May 5, 2020:

    What is the idea? AFAIK singleShot does a queued connection too.

    I thought so too. But careful reading https://doc.qt.io/qt-5/qtimer.html didn't point a such statement.


    hebasto commented at 9:54 AM on May 5, 2020:

    Also I'm curious why only windows reveals this bug?

  6. promag commented at 1:49 PM on May 5, 2020: member

    Concept ACK. This will go away once we use latest invokeMethod that support pointer to member or lambda.

    Looks like QTimer::singleShot changed after 5.9.7:

    The change in this PR does what latest singleShot does so I'd say this should fix the problem.

    I'd improve this PR by

    • assert invokeMethod result;
    • do the same in CreateWalletActivity::createWallet().
  7. hebasto commented at 2:40 PM on May 11, 2020: member

    Closed in favor of #18948.

  8. hebasto closed this on May 11, 2020

  9. hebasto deleted the branch on May 11, 2020
  10. bitcoin locked this on Feb 15, 2022

github-metadata-mirror

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-05-20 06:54 UTC