Skip to content

Commit 7497741

Browse files
committed
fixed possible crash at shutdown
1 parent 3693989 commit 7497741

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libi2pd/NTCP2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,7 @@ namespace transport
15501550

15511551
void NTCP2Server::Stop ()
15521552
{
1553+
m_EstablisherService.Stop ();
15531554
{
15541555
// we have to copy it because Terminate changes m_NTCP2Sessions
15551556
auto ntcpSessions = m_NTCP2Sessions;
@@ -1565,7 +1566,6 @@ namespace transport
15651566
m_TerminationTimer.cancel ();
15661567
m_ProxyEndpoint = nullptr;
15671568
}
1568-
m_EstablisherService.Stop ();
15691569
StopIOService ();
15701570
}
15711571

libi2pd/Tunnel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ namespace tunnel
296296

297297
bool m_IsRunning;
298298
std::thread * m_Thread;
299+
i2p::util::MemoryPoolMt<I2NPMessageBuffer<I2NP_TUNNEL_ENPOINT_MESSAGE_SIZE> > m_I2NPTunnelEndpointMessagesMemoryPool;
300+
i2p::util::MemoryPoolMt<I2NPMessageBuffer<I2NP_TUNNEL_MESSAGE_SIZE> > m_I2NPTunnelMessagesMemoryPool;
299301
std::map<uint32_t, std::shared_ptr<InboundTunnel> > m_PendingInboundTunnels; // by replyMsgID
300302
std::map<uint32_t, std::shared_ptr<OutboundTunnel> > m_PendingOutboundTunnels; // by replyMsgID
301303
std::list<std::shared_ptr<InboundTunnel> > m_InboundTunnels;
@@ -306,8 +308,6 @@ namespace tunnel
306308
std::list<std::shared_ptr<TunnelPool>> m_Pools;
307309
std::shared_ptr<TunnelPool> m_ExploratoryPool;
308310
i2p::util::Queue<std::shared_ptr<I2NPMessage> > m_Queue;
309-
i2p::util::MemoryPoolMt<I2NPMessageBuffer<I2NP_TUNNEL_ENPOINT_MESSAGE_SIZE> > m_I2NPTunnelEndpointMessagesMemoryPool;
310-
i2p::util::MemoryPoolMt<I2NPMessageBuffer<I2NP_TUNNEL_MESSAGE_SIZE> > m_I2NPTunnelMessagesMemoryPool;
311311
uint32_t m_MaxNumTransitTunnels;
312312
// count of tunnels for total TCSR algorithm
313313
int m_TotalNumSuccesiveTunnelCreations, m_TotalNumFailedTunnelCreations;

0 commit comments

Comments
 (0)