Files
bitcoin/src
Hennadii Stepanov 776d48dd56 Merge bitcoin-core/gui#801: Fix nullptr clientModel access during shutdown
b7aa717cdd refactor: gui, simplify boost signals disconnection (furszy)
f3a612f901 gui: guard accessing a nullptr 'clientModel' (furszy)

Pull request description:

  Fixing #800.

  During shutdown, already queue events dispatched from the backend such
  'numConnectionsChanged' and 0networkActiveChanged' could try to access
  the clientModel object, which might not exist because we manually delete
  it inside 'BitcoinApplication::requestShutdown()'.

  This happen because boost does not clears the queued events when they arise
  concurrently with the signal disconnection (see https://www.boost.org/doc/libs/1_55_0/doc/html/signals2/thread-safety.html).
  From the docs:
  1) "Note that since we unlock the connection's mutex before executing its associated slot, it is possible a slot will still be executing after it has been disconnected by a [connection::disconnect](https://www.boost.org/doc/libs/1_55_0/doc/html/boost/signals2/connection.html#idp89761576-bb)(), if the disconnect was called concurrently with signal invocation."
  2)  "The fact that concurrent signal invocations use the same combiner object means you need to insure any custom combiner you write is thread-safe"

  So, we need to guard `clientModel` before accessing it at the handler side.

ACKs for top commit:
  hebasto:
    re-ACK b7aa717cdd

Tree-SHA512: f1a21d69248628f6a13556a9438c9e4ea9f0a3678aab09ddfe836e78e4eee405a6730d37d39f1445068ada3a110b655b619cf0e090fc2d0cdf99bed061364aeb
2024-03-04 10:15:43 +00:00
..
2024-02-01 13:52:05 +01:00
2023-12-11 18:22:13 +01:00
2023-10-12 11:27:19 +02:00
2022-12-24 23:49:50 +00:00
2024-01-05 17:16:38 +00:00
2024-02-01 13:52:05 +01:00
2023-11-21 13:15:44 +00:00
2023-12-11 18:22:13 +01:00
2023-11-16 11:36:22 +10:00
2023-06-16 10:38:19 +01:00
2023-09-13 11:37:45 +01:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-11-30 11:28:19 +01:00
2023-11-28 12:42:07 +01:00
2023-01-12 13:42:44 +00:00
2023-06-16 10:38:19 +01:00
2023-07-19 18:12:42 +02:00
2023-11-30 11:27:54 +01:00
2024-01-05 17:16:38 +00:00
2024-02-01 13:52:05 +01:00
2023-11-16 11:36:22 +10:00