diff options
author | Thomas White <taw@physics.org> | 2021-05-28 16:59:16 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-28 17:00:00 +0200 |
commit | 6dd95c2333dad91539f15f198e3d584f54bcaaa7 (patch) | |
tree | 3f19bb186d0145f8a06ae97fa16499339be6b7b9 /src/gui_backend_slurm.c | |
parent | 2b07915297c45477b473f4c30feeba0978e0c99a (diff) |
GUI: Store relative paths of results
This allows project folders to be relocated more easily.
At the same time, I fixed the weird ownership semantics of
add_indexing_result and add_merge_result.
Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/31
Diffstat (limited to 'src/gui_backend_slurm.c')
-rw-r--r-- | src/gui_backend_slurm.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui_backend_slurm.c b/src/gui_backend_slurm.c index 1da344ce..173ee65e 100644 --- a/src/gui_backend_slurm.c +++ b/src/gui_backend_slurm.c @@ -662,9 +662,14 @@ static void *run_indexing(const char *job_title, if ( job != NULL ) { job->n_frames = proj->n_frames; job->n_blocks = n_blocks; - add_indexing_result(proj, strdup(job_title), streams, n_blocks); + add_indexing_result(proj, job_title, streams, n_blocks); } + for ( i=0; i<n_blocks; i++ ) { + free(streams[i]); + } + free(streams); + g_object_unref(workdir); return job; @@ -871,11 +876,7 @@ static void *run_ambi(const char *job_title, g_free(sc_filename); if ( job != NULL ) { - char **streams = malloc(sizeof(char *)); - if ( streams != NULL ) { - streams[0] = stream_str; - add_indexing_result(proj, strdup(job_title), streams, 1); - } + add_indexing_result(proj, job_title, &stream_str, 1); } g_object_unref(workdir); @@ -943,7 +944,10 @@ static void *run_merging(const char *job_title, hkl2 = g_file_get_path(hkl_gfile); g_object_unref(hkl_gfile); - add_merge_result(proj, strdup(job_title), hkl, hkl1, hkl2); + add_merge_result(proj, job_title, hkl, hkl1, hkl2); + g_free(hkl); + g_free(hkl1); + g_free(hkl2); } g_object_unref(workdir); |