Closed hgyxbll closed 2 weeks ago
this do not HeapFree pWatch.
I think you're right. Sorry, this is very old code, I should review it again.
if GetQueuedCompletionStatus is ok, and than will call Lock lock( mWatchesLock );. but before call it, user call removeWatch, then WatchCallback will access null pointer.
You're correct, after the lock it should check that the overlapped object is still available.
I'll fix them next week since I don't have access to a Windows machine right now and I would like to test the fix.
Thanks for taking a look at the implementation!
memory leak doubt: at WatcherWin32.cpp. CreateWatch use below code.
DestroyWatch use below code.
this do not HeapFree pWatch.
Is it may leak memory?
Thread conflict: at FileWatcherWin32.cpp.
if GetQueuedCompletionStatus is ok, and than will call
Lock lock( mWatchesLock );
. but before call it, user call removeWatch, then WatchCallback will access null pointer.