]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOWorkLoop.cpp
xnu-2050.18.24.tar.gz
[apple/xnu.git] / iokit / Kernel / IOWorkLoop.cpp
index 51045a234cfe441eb52768a62bf6af452a3e72a9..d2c28b04391aa89c968d6a38801f766e2d89c4e1 100644 (file)
@@ -556,6 +556,8 @@ IOReturn IOWorkLoop::_maintRequest(void *inC, void *inD, void *, void *)
 
     case mRemoveEvent:
         if (inEvent->getWorkLoop()) {
+               IOStatisticsDetachEventSource();
+               
                if (eventSourcePerformsWork(inEvent)) {
                                if (eventChain == inEvent)
                                        eventChain = inEvent->getNext();
@@ -595,7 +597,6 @@ IOReturn IOWorkLoop::_maintRequest(void *inC, void *inD, void *, void *)
             inEvent->setNext(0);
             inEvent->release();
             SETP(&fFlags, kLoopRestart);
-            IOStatisticsDetachEventSource();
         }
         break;