bugfix: destroying attr objects immediately after pthread_create

This commit is contained in:
chrox
2012-11-22 11:06:22 +08:00
parent 060eeec1c1
commit 5b0e4b457b
2 changed files with 2 additions and 0 deletions

1
djvu.c
View File

@@ -535,6 +535,7 @@ static int reflowPage(lua_State *L) {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&rf_thread, &attr, k2pdfopt_reflow_bmp, (void*) kctx);
pthread_attr_destroy(&attr);
} else {
k2pdfopt_reflow_bmp(kctx);
}

1
pdf.c
View File

@@ -619,6 +619,7 @@ static int reflowPage(lua_State *L) {
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create( &rf_thread, &attr, k2pdfopt_reflow_bmp, (void*) kctx);
pthread_attr_destroy(&attr);
} else {
k2pdfopt_reflow_bmp(kctx);
}