summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-06-21 19:02:02 (GMT)
committerstanton <stanton>1999-06-21 19:02:02 (GMT)
commit364bb9f49bf2d5cc61693a08a28e4a2a5af91050 (patch)
tree0e42ad2557988ed36afd911728b894bfafb2f098 /unix/tclUnixThrd.c
parentfd32291979f860c44db1c144d7c12edf9f31646f (diff)
downloadtcl-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/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c10
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;
}
/*