[GB.INOTIFY]
* BUG: (Bug 730) Don't pass NULL key and zero length to GB.HashTable.Remove() * OPT: Use GB.StringLength() where possible git-svn-id: svn://localhost/gambas/trunk@7303 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
083e138e9f
commit
24e542b4c5
@ -73,7 +73,8 @@ static CWATCH *find_watch_path(CINOTIFY *ino, const char *path)
|
|||||||
{
|
{
|
||||||
CWATCH *watch = NULL;
|
CWATCH *watch = NULL;
|
||||||
|
|
||||||
GB.HashTable.Get(ino->watches, path, 0, (void **) &watch);
|
GB.HashTable.Get(ino->watches, path, GB.StringLength((char *) path),
|
||||||
|
(void **) &watch);
|
||||||
return watch;
|
return watch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +129,10 @@ static void destroy_watch(CWATCH *watch)
|
|||||||
inotify_rm_watch(_ino.fd, watch->wd);
|
inotify_rm_watch(_ino.fd, watch->wd);
|
||||||
GB.HashTable.Remove(_ino.watches, (char *) &watch->wd,
|
GB.HashTable.Remove(_ino.watches, (char *) &watch->wd,
|
||||||
sizeof(watch->wd));
|
sizeof(watch->wd));
|
||||||
GB.HashTable.Remove(_ino.watches, watch->path, 0);
|
if (watch->path) {
|
||||||
|
GB.HashTable.Remove(_ino.watches, watch->path,
|
||||||
|
GB.StringLength(watch->path));
|
||||||
|
}
|
||||||
|
|
||||||
GB.FreeString(&watch->path);
|
GB.FreeString(&watch->path);
|
||||||
GB.StoreVariant(NULL, &watch->tag);
|
GB.StoreVariant(NULL, &watch->tag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user