AntelopeIO / leap

C++ implementation of the Antelope protocol
Other
113 stars 69 forks source link

fix `net_plugin_impl` destruction order: destroy thread_pool's executor after users of it #2300

Closed spoonincode closed 3 months ago

spoonincode commented 3 months ago

net_plugin_impl currently destroys its named_thread_pool before a number of users of it such as expire_timer. Those users can, and do, access their executor on their destruction which in this case is accessing an already destroyed executor.

Move the named_thread_pool up to the top so it's destroyed last. A nice side effect of this is being able to clean up a number of the unique_ptrs to just being a plain member.

ericpassmore commented 3 months ago

Note:start group: STABILITY category: INTERNALS summary: Move net_plugin_impl to be destroyed last, this simplifies code and resolves consumers trying to access it after destruction. Note:end