Closed ritalin closed 1 day ago
In current implementation, it seems that efsw_addwatch_withoptions function is selecting the same callback, even if param is different.
efsw_addwatch_withoptions
param
https://github.com/SpartanJ/efsw/blob/master/src/efsw/FileWatcherCWrapper.cpp#L31
Watcher_CAPI::mParam has also compared with param in find_callback function
Watcher_CAPI::mParam
find_callback
Watcher_CAPI* find_callback( efsw_watcher watcher, efsw_pfn_fileaction_callback fn, void *param ) { for ( std::vector<Watcher_CAPI*>::iterator i = g_callbacks.begin(); i != g_callbacks.end(); ++i ) { Watcher_CAPI* callback = *i; if ( callback->mFn == fn && callback->mWatcher == watcher && callback->mParam == param ) return *i; } return NULL; }
Thanks for reporting it! I just pushed the fix you proposed.
What's happens?
In current implementation, it seems that
efsw_addwatch_withoptions
function is selecting the same callback, even ifparam
is different.https://github.com/SpartanJ/efsw/blob/master/src/efsw/FileWatcherCWrapper.cpp#L31
Solution proposal
Watcher_CAPI::mParam
has also compared withparam
infind_callback
function