Skip to content

Commit

Permalink
Revert "Fix segfault when an Exception is raised from unbind callback (
Browse files Browse the repository at this point in the history
…#766)"

This reverts commit 3621c04.
  • Loading branch information
sodabrew committed Apr 28, 2018
1 parent 20dd5d4 commit 9eb3fb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
21 changes: 6 additions & 15 deletions ext/em.cpp
Expand Up @@ -164,8 +164,6 @@ EventMachine_t::~EventMachine_t()
{
// Run down descriptors
size_t i;
for (i = 0; i < DescriptorsToDelete.size(); i++)
delete DescriptorsToDelete[i];
for (i = 0; i < NewDescriptors.size(); i++)
delete NewDescriptors[i];
for (i = 0; i < Descriptors.size(); i++)
Expand Down Expand Up @@ -838,17 +836,6 @@ void EventMachine_t::_CleanupSockets()
EventableDescriptor *ed = Descriptors[i];
assert (ed);
if (ed->ShouldDelete()) {
DescriptorsToDelete.push_back(ed);
}
else
Descriptors [j++] = ed;
}
while ((size_t)j < Descriptors.size())
Descriptors.pop_back();

nSockets = DescriptorsToDelete.size();
for (i=0; i < nSockets; i++) {
EventableDescriptor *ed = DescriptorsToDelete[i];
#ifdef HAVE_EPOLL
if (Poller == Poller_Epoll) {
assert (epfd != -1);
Expand All @@ -864,9 +851,13 @@ void EventMachine_t::_CleanupSockets()
ModifiedDescriptors.erase(ed);
}
#endif
delete ed;
delete ed;
}
else
Descriptors [j++] = ed;
}
DescriptorsToDelete.clear();
while ((size_t)j < Descriptors.size())
Descriptors.pop_back();
}

/*********************************
Expand Down
1 change: 0 additions & 1 deletion ext/em.h
Expand Up @@ -242,7 +242,6 @@ class EventMachine_t
std::map<int, Bindable_t*> Pids;
std::vector<EventableDescriptor*> Descriptors;
std::vector<EventableDescriptor*> NewDescriptors;
std::vector<EventableDescriptor*> DescriptorsToDelete;
std::set<EventableDescriptor*> ModifiedDescriptors;

SOCKET LoopBreakerReader;
Expand Down

0 comments on commit 9eb3fb6

Please sign in to comment.