diff options
author | stanton <stanton> | 1999-06-21 19:02:02 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-06-21 19:02:02 (GMT) |
commit | 364bb9f49bf2d5cc61693a08a28e4a2a5af91050 (patch) | |
tree | 0e42ad2557988ed36afd911728b894bfafb2f098 /unix | |
parent | fd32291979f860c44db1c144d7c12edf9f31646f (diff) | |
download | tcl-364bb9f49bf2d5cc61693a08a28e4a2a5af91050.zip tcl-364bb9f49bf2d5cc61693a08a28e4a2a5af91050.tar.gz tcl-364bb9f49bf2d5cc61693a08a28e4a2a5af91050.tar.bz2 |
* unix/tclUnixThrd.c (TclpThreadCreate): Fixed memory leak where
thread attributes were not being released. [Bug: 2254]
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixThrd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index b00bf42..cb66d08 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -72,14 +72,18 @@ TclpThreadCreate(idPtr, proc, clientData) ClientData clientData; /* The one argument to Main() */ { pthread_attr_t attr; + int result; pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); - if (pthread_create((pthread_t *)idPtr, &attr, (void * (*)())proc, (void *)clientData) < 0) { - return TCL_ERROR; + if (pthread_create((pthread_t *)idPtr, &attr, + (void * (*)())proc, (void *)clientData) < 0) { + result = TCL_ERROR; } else { - return TCL_OK; + result = TCL_OK; } + pthread_attr_destroy(&attr); + return result; } /* |