// Either way clean up all of our resources and return.
if (controlG) {
+ controlG->workLoop = 0;
controlG->release();
controlG = 0;
}
if (eventChain == inEvent)
eventChain = inEvent->getNext();
else {
- IOEventSource *event, *next;
+ IOEventSource *event, *next = 0;
event = eventChain;
- while ((next = event->getNext()) && next != inEvent)
+ if (event) while ((next = event->getNext()) && (next != inEvent))
event = next;
if (!next) {
if (passiveEventChain == inEvent)
passiveEventChain = inEvent->getNext();
else {
- IOEventSource *event, *next;
+ IOEventSource *event, *next = 0;
event = passiveEventChain;
- while ((next = event->getNext()) && next != inEvent)
+ if (event) while ((next = event->getNext()) && (next != inEvent))
event = next;
if (!next) {