Commit 84c55cc5 authored by jan.koester's avatar jan.koester
Browse files

te4ee

parent 04d27cbe
Loading
Loading
Loading
Loading
+3 −9
Changes for src/event/kqueue.cpp: 3 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -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*/
@@ -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;
@@ -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;