bugfix: destroying attr objects immediately after pthread_create

This commit is contained in:
chrox committed 2012-11-26 22:17:27 +08:00
1 parent 060eeec1c1
commit 5b0e4b457b
2 files changed
+2

No files matched your search

+1
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
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);
}