aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeitaro Yamashita <k.yamashita@spring8.or.jp>2014-11-29 03:10:08 +0900
committerThomas White <taw@physics.org>2014-12-01 16:20:18 +0100
commit2f4033255192812bd3c01bd8568a083dcd72ec65 (patch)
treec3b4bd57edb74f1a28229805e4112742a811be39
parentca37981099e3eabd70f7b57eb22fd1cde551bd0f (diff)
process_hkl: Fix memory leak when --start-after= used.
-rw-r--r--src/process_hkl.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index 9abfc501..8e82b1a1 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -426,20 +426,16 @@ static int merge_all(Stream *st, RefList *model, RefList *reference,
Crystal *cr = image.crystals[i];
n_crystals_seen++;
- if ( n_crystals_seen <= start_after ) continue;
-
- if ( crystal_get_resolution_limit(cr) < min_res ) {
- continue;
+ if ( (n_crystals_seen > start_after)
+ && (crystal_get_resolution_limit(cr) >= min_res) ) {
+ n_crystals++;
+ r = merge_crystal(model, &image, cr, reference, sym,
+ hist_vals, hist_h, hist_k, hist_l,
+ hist_i, config_nopolar, min_snr,
+ max_adu, push_res, min_cc, do_scale, stat);
+ if ( r == 0 ) n_crystals_used++;
}
- n_crystals++;
- r = merge_crystal(model, &image, cr, reference, sym,
- hist_vals, hist_h, hist_k, hist_l,
- hist_i, config_nopolar, min_snr,
- max_adu, push_res, min_cc, do_scale, stat);
-
- if ( r == 0 ) n_crystals_used++;
-
reflist_free(crystal_get_reflections(cr));
cell_free(crystal_get_cell(cr));
crystal_free(cr);