File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ namespace SL {
7474
7575 };
7676
77- class WSInternal : std::enable_shared_from_this<WSInternal> {
77+ class WSInternal : public std ::enable_shared_from_this<WSInternal> {
7878 public:
7979 WSInternal (std::shared_ptr<WSContextImpl>& p) :WSContextImpl_(p), sslcontext(asio::ssl::context::tlsv11) {}
8080 virtual ~WSInternal () {}
@@ -141,13 +141,13 @@ namespace SL {
141141 virtual void send (WSMessage& msg, bool compressmessage) {
142142 auto self (std::static_pointer_cast<WSocket<SOCKETTYPE, PARENTTYPE>>( shared_from_this ()));
143143 auto p (Parent.lock ());
144- sendImpl (p, self, msg, compressmessage);
144+ if (p) sendImpl (p, self, msg, compressmessage);
145145 }
146146 // send a close message and close the socket
147147 virtual void close (unsigned short code, const std::string& msg) {
148148 auto self (std::static_pointer_cast<WSocket<SOCKETTYPE, PARENTTYPE>>(shared_from_this ()));
149149 auto p (Parent.lock ());
150- closeImpl (p, self, code, msg);
150+ if (p) closeImpl (p, self, code, msg);
151151 }
152152
153153 void canceltimers () {
You can’t perform that action at this time.
0 commit comments