From 7832232ae74501f08f1d530a332e7c573785c89e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 2 Mar 2020 15:59:58 +0100 Subject: Load image list and implement stepping back/forward --- src/crystfelimageview.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/crystfelimageview.c') diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c index 028c381e..65698a64 100644 --- a/src/crystfelimageview.c +++ b/src/crystfelimageview.c @@ -372,6 +372,7 @@ GtkWidget *crystfel_image_view_new() iv->zoom = 1.0; iv->filename = NULL; iv->event = NULL; + iv->image = NULL; g_signal_connect(G_OBJECT(iv), "destroy", G_CALLBACK(destroy_sig), iv); @@ -465,12 +466,14 @@ static int reload_image(CrystFELImageView *iv) /* Free old stuff */ if ( iv->image != NULL ) { - image_free(iv->image); - if ( iv->image->detgeom != NULL ) { - for ( i=0; iv->image->detgeom->n_panels; iv++ ) { - gdk_pixbuf_unref(iv->pixbufs[i]); + if ( (iv->image->detgeom != NULL) && (iv->pixbufs != NULL) ) { + for ( i=0; iimage->detgeom->n_panels; i++ ) { + if ( iv->pixbufs[i] != NULL ) { + gdk_pixbuf_unref(iv->pixbufs[i]); + } } } + image_free(iv->image); } iv->image = image_read(iv->dtempl, iv->filename, iv->event); -- cgit v1.2.3