Loading src/event/kqueue.cpp +3 −9 Changes for src/event/kqueue.cpp: 3 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -116,10 +116,7 @@ namespace netplus { }; ~poll() { int maxcon=_ServerSocket->getMaxconnections(); for (int i = 0; i < maxcon; ++i){ delete (con*)_Events[i].udata; } delete[] _Events; }; /*basic functions*/ Loading Loading @@ -330,6 +327,7 @@ namespace netplus { void CloseEventHandler(int pos, const int tid, ULONG_PTR args) { // This global lock is essential for making deletion safe std::lock_guard<std::mutex> global_lock(CLOSE_HANDLER_MUTEX); con *ccon = (con*)_Events[pos].udata; Loading @@ -340,11 +338,7 @@ namespace netplus { { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); if (ccon->csock) { setpollEvents(ccon, 0, EV_DELETE); } _Events[pos].udata = nullptr; _Events[pos].udata = nullptr; // Clear the pointer } delete ccon; Loading Loading
src/event/kqueue.cpp +3 −9 Changes for src/event/kqueue.cpp: 3 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -116,10 +116,7 @@ namespace netplus { }; ~poll() { int maxcon=_ServerSocket->getMaxconnections(); for (int i = 0; i < maxcon; ++i){ delete (con*)_Events[i].udata; } delete[] _Events; }; /*basic functions*/ Loading Loading @@ -330,6 +327,7 @@ namespace netplus { void CloseEventHandler(int pos, const int tid, ULONG_PTR args) { // This global lock is essential for making deletion safe std::lock_guard<std::mutex> global_lock(CLOSE_HANDLER_MUTEX); con *ccon = (con*)_Events[pos].udata; Loading @@ -340,11 +338,7 @@ namespace netplus { { std::lock_guard<std::recursive_mutex> lock(ccon->event_mutex); if (ccon->csock) { setpollEvents(ccon, 0, EV_DELETE); } _Events[pos].udata = nullptr; _Events[pos].udata = nullptr; // Clear the pointer } delete ccon; Loading