summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-24 12:05:38 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-24 12:05:38 -0400
commit53e9dedf5e9caacd1ef7a9f44da4d2218ba23cb2 (patch)
tree510a425459f506d6abd47f16ceb173600ca95a85
parenteab1b0db01ea069772c04fbbf11d98fddb9a0e12 (diff)
downloaddimension-53e9dedf5e9caacd1ef7a9f44da4d2218ba23cb2.tar.xz
Correctly propagate errors in raytracing worker threads.
-rw-r--r--libdimension/raytrace.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 98f941b..950b4f2 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -123,12 +123,8 @@ dmnsn_raytrace_scene_thread(void *ptr)
dmnsn_error(DMNSN_SEVERITY_MEDIUM,
"Couldn't join worker thread in raytrace engine.");
}
- if (ptr) {
- int retval = *(int *)ptr;
- dmnsn_free(ptr);
- if (retval != 0)
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Error occurred in worker thread.");
- }
+ if (!ptr)
+ dmnsn_error(DMNSN_SEVERITY_HIGH, "Error occurred in worker thread.");
}
dmnsn_complete_timer(payload->scene->render_timer);
@@ -153,7 +149,7 @@ dmnsn_raytrace_scene_multithread_thread(void *ptr)
dmnsn_raytrace_payload *payload = ptr;
dmnsn_raytrace_scene_impl(payload->progress, payload->scene,
payload->prtree, payload->index, payload->threads);
- return NULL;
+ return payload; /* Return non-NULL for success */
}
/*