power-mgnt-close-handles-20040321
authorJeffrey Altman <jaltman@mit.edu>
Mon, 22 Mar 2004 04:07:10 +0000 (04:07 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 22 Mar 2004 04:07:10 +0000 (04:07 +0000)
Close the Handles before terminating the thread to ensure that
additional power events cannot be queued during shutdown.

src/WINNT/afsd/afsd_flushvol.c

index e2238d7..83267fa 100644 (file)
@@ -341,6 +341,9 @@ afsd_ServiceFlushVolumesThreadProc(LPVOID lpParam)
                case WAIT_OBJECT_0:
                        // termination signaled
                        RevertToSelf();
+            CheckAndCloseHandle(ThreadInfo.hEventPowerEvent);
+            CheckAndCloseHandle(ThreadInfo.hEventResumeMain);
+            CheckAndCloseHandle(ThreadInfo.hEventTerminate);
                        ExitThread(0);
                        break;