diff options
author | Thomas White <taw@physics.org> | 2020-07-03 16:24:20 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:53:45 +0200 |
commit | ac7e3f165635c5f9b39ec314b3b0647d11ec1ddb (patch) | |
tree | 608ff2b6f88dfe76e8c1d4ad217e411353011def /src | |
parent | 4e3f0e5f30c8e019425c95cb1b0d4948ec23f0be (diff) |
Fix clear_project_files
Diffstat (limited to 'src')
-rw-r--r-- | src/gui_project.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui_project.c b/src/gui_project.c index 9f610420..1b022d2a 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -229,16 +229,19 @@ void clear_project_files(struct crystfelproject *proj) { int i; - for ( i=0; i<proj->n_frames; i++ ) { - free(proj->filenames[i]); - free(proj->events[i]); + if ( proj->filenames != NULL ) { + for ( i=0; i<proj->n_frames; i++ ) { + free(proj->filenames[i]); + free(proj->events[i]); + } + free(proj->filenames); + free(proj->events); } - free(proj->filenames); - free(proj->events); proj->n_frames = 0; proj->max_frames = 0; proj->filenames = NULL; proj->events = NULL; + proj->stream = NULL; } |