From 19270c74fc1ad031cdb1dbe4c9b7a06e5d99a47a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 2 Mar 2011 11:39:17 +0100 Subject: hdfsee: Don't crash when loading a new geometry --- src/dw-hdfsee.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/dw-hdfsee.c') diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index 115d29f4..406af637 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -711,6 +711,8 @@ static int load_geometry_file(DisplayWindow *dw, struct image *image, { struct detector *geom; GtkWidget *w; + int using_loaded = 0; + if ( dw->image->det == dw->loaded_geom ) using_loaded = 1; geom = get_detector_geometry(filename); if ( geom == NULL ) { @@ -727,8 +729,12 @@ static int load_geometry_file(DisplayWindow *dw, struct image *image, } + /* Sort out the mess */ if ( dw->loaded_geom != NULL ) free_detector_geometry(dw->loaded_geom); dw->loaded_geom = geom; + if ( using_loaded ) { + dw->image->det = dw->loaded_geom; + } w = gtk_ui_manager_get_widget(dw->ui, "/ui/displaywindow/view/usegeom"); -- cgit v1.2.3