|
From: Simon V. <sim...@or...> - 2005-07-11 21:40:27
|
Hello,
I have noticed the following behaviour with valgrind, if you create
a key with a destructor and you set it from the main thread:
if (rc=pthread_key_create(&gKey,free))
{
perror("pthread_key_create");
}
else
{
if (rc=pthread_setspecific(gKey,(void*)strdup("I will be
reported as a leak")))
{
perror("pthread_setspecific1");
}
}
It will report a leak if the pthread_setspecific() was called from the
main thread(wrong) but no leak when its called from a spawned
thread(correct). I'm not sure it's a valgrind bug however.
Thanks
--Simon
|