aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-02 11:39:17 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:16 +0100
commit19270c74fc1ad031cdb1dbe4c9b7a06e5d99a47a (patch)
tree12c84cb83668888f4968418c377ce9622a383dcd
parent55d04fd7b2c761568af353deb0fd17f8c9f11c76 (diff)
hdfsee: Don't crash when loading a new geometry
-rw-r--r--src/dw-hdfsee.c6
1 files changed, 6 insertions, 0 deletions
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");