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 #2299

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.

spoonincode commented 3 months ago

goofed up some branching & PRing; see replacement PR