summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-06-21 19:02:02 (GMT)
committerstanton <stanton@noemail.net>1999-06-21 19:02:02 (GMT)
commit83ce3b989afd0f332cf014792578dce6968d789c (patch)
tree0e42ad2557988ed36afd911728b894bfafb2f098 /unix/tclUnixThrd.c
parent9226d56b148ac01b85ad509680647eb420b879f6 (diff)
downloadtcl-83ce3b989afd0f332cf014792578dce6968d789c.zip
tcl-83ce3b989afd0f332cf014792578dce6968d789c.tar.gz
tcl-83ce3b989afd0f332cf014792578dce6968d789c.tar.bz2
* unix/tclUnixThrd.c (TclpThreadCreate): Fixed memory leak where
thread attributes were not being released. [Bug: 2254] FossilOrigin-Name: d3a52252795c496fca48384c185cbeeb601f8e31
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;
}
/*