Index: src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- src/report/report-gnome/dialog-style-sheet.c	(revision 17492)
+++ src/report/report-gnome/dialog-style-sheet.c	(working copy)
@@ -117,8 +117,8 @@
     gtk_tree_path_free(path);
   }
   gtk_tree_row_reference_free (ssi->row_ref);
+  gnc_options_dialog_destroy(ssi->odialog);
   gnc_option_db_destroy(ssi->odb);
-  gnc_options_dialog_destroy(ssi->odialog);
   scm_gc_unprotect_object(ssi->stylesheet);
   g_free(ssi);
 }
Index: src/report/report-gnome/window-report.c
===================================================================
--- src/report/report-gnome/window-report.c	(revision 17492)
+++ src/report/report-gnome/window-report.c	(working copy)
@@ -112,9 +112,9 @@
   SCM    set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
   
   scm_call_2(set_editor, win->cur_report, SCM_BOOL_F);
+  gnc_options_dialog_destroy(win->win);
   gnc_option_db_destroy(win->db);
   scm_gc_unprotect_object(win->scm_options);
-  gnc_options_dialog_destroy(win->win);
   g_free(win);
 }
 
