summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/main.cc')
-rw-r--r--Build/source/utils/asymptote/main.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/main.cc b/Build/source/utils/asymptote/main.cc
index ad8e6292e0c..0cd7a281d58 100644
--- a/Build/source/utils/asymptote/main.cc
+++ b/Build/source/utils/asymptote/main.cc
@@ -154,6 +154,12 @@ void *asymain(void *A)
int status;
while(wait(&status) > 0);
}
+#ifdef HAVE_LIBGL
+#ifdef HAVE_LIBPTHREAD
+ if(gl::glthread)
+ pthread_join(gl::mainthread,NULL);
+#endif
+#endif
exit(em.processStatus() || interact::interactive ? 0 : 1);
}
@@ -173,15 +179,13 @@ int main(int argc, char *argv[])
#ifdef HAVE_LIBPTHREAD
if(gl::glthread) {
- pthread_t thread;
try {
- if(pthread_create(&thread,NULL,asymain,&args) == 0) {
- gl::mainthread=pthread_self();
+ if(pthread_create(&gl::mainthread,NULL,asymain,&args) == 0) {
while(true) {
camp::glrenderWrapper();
gl::initialize=true;
}
- }
+ } else gl::glthread=false;
} catch(std::bad_alloc&) {
outOfMemory();
}