From eb9ea97e2158b3fc2ff51c9d4b40adc13839604b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 18 Dec 2016 13:01:28 -0500 Subject: [PATCH] don't crash --- SAM.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SAM.cpp b/SAM.cpp index 5bf9a74b..e109e3ab 100644 --- a/SAM.cpp +++ b/SAM.cpp @@ -417,7 +417,8 @@ namespace client HandleI2PAccept(stream); } else { SendMessageReply (SAM_STREAM_STATUS_I2P_ERROR, strlen(SAM_STREAM_STATUS_I2P_ERROR), true); - Terminate(); + auto s = shared_from_this (); + m_Owner.GetService ().post ([s] { s->Terminate (); }); } } size_t SAMSocket::ProcessDatagramSend (char * buf, size_t len, const char * data)