diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | thread_pthread.c | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Thu Jul 22 22:13:48 2010 Yusuke Endoh <mame@tsg.ne.jp> + + * thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory + must be called even when pthread_getattr_np is used. + [ruby-core:31269] + Wed Jul 21 12:39:15 2010 Yusuke Endoh <mame@tsg.ne.jp> * lib/cmath.rb (CMath#cbrt): cbrt should accept a negative real diff --git a/thread_pthread.c b/thread_pthread.c index 95fb77a7f8..c2fde5c82e 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -234,9 +234,7 @@ get_stack(void **addr, size_t *size) # endif CHECK_ERR(pthread_attr_getguardsize(&attr, &guard)); *size -= guard; -# ifndef HAVE_PTHREAD_GETATTR_NP pthread_attr_destroy(&attr); -# endif #elif defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP pthread_t th = pthread_self(); *addr = pthread_get_stackaddr_np(th); |