aboutsummaryrefslogtreecommitdiff
path: root/src/partial_sim.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-11-22 18:20:33 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:41 +0100
commit84e4e19b65fc2c7a61b4d7449a9d1704d2cd0de1 (patch)
treea44406a7a409e00e01f79bda3ca0146b35c1aba9 /src/partial_sim.c
parent50b0746fe6c1abed98c6cb4b13268c65cb2fd0a4 (diff)
Don't free() something just before using it
Diffstat (limited to 'src/partial_sim.c')
-rw-r--r--src/partial_sim.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index fc4a400a..aec97810 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -254,10 +254,6 @@ static void finalise_job(void *vqargs, void *vwargs)
write_chunk(qargs->stream, &wargs->image, NULL, STREAM_INTEGRATED);
- reflist_free(wargs->image.reflections);
- cell_free(wargs->image.indexed_cell);
- free(wargs);
-
for ( i=0; i<NBINS; i++ ) {
qargs->n_ref[i] += wargs->n_ref[i];
qargs->p_hist[i] += wargs->p_hist[i];
@@ -265,6 +261,10 @@ static void finalise_job(void *vqargs, void *vwargs)
qargs->n_done++;
progress_bar(qargs->n_done, qargs->n_to_do, "Simulating");
+
+ reflist_free(wargs->image.reflections);
+ cell_free(wargs->image.indexed_cell);
+ free(wargs);
}