+ if (metadata)
+ {
+ const char *sav_name = (fh_get_referent (handle) == FH_REF_FILE
+ ? fh_get_file_name (handle)
+ : fh_get_name (handle));
+ if (!mdd_write (metadata, dict, sav_name))
+ goto error;
+ }
+
+ map = case_map_stage_get_case_map (stage);
+ case_map_stage_destroy (stage);