From a38cb62ffc29ec9fb74628e8850ac801aef9f548 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 20 Jul 2004 02:30:29 +0000 Subject: [PATCH] (main): If frame creation is falied, exit by error. Call M17N_FINI after destroying the application context. --- example/medit.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/example/medit.c b/example/medit.c index f948d4e..d8d25d2 100644 --- a/example/medit.c +++ b/example/medit.c @@ -2441,6 +2441,8 @@ main (int argc, char **argv) m17n_object_unref (face); } frame = mframe (plist); + if (! frame) + FATAL_ERROR ("%s\n", "Fail to create a frame!"); m17n_object_unref (plist); face_default = mface_copy ((MFace *) mframe_get_prop (frame, Mface)); default_face_list = mplist (); @@ -2879,13 +2881,6 @@ main (int argc, char **argv) m17n_object_unref (default_face_list); m17n_object_unref (selection); - M17N_FINI (); - - free (fontset_name); - free (filename); - free (input_method_table); - free (InputMethodMenus); - XFreeGC (display, mono_gc); XFreeGC (display, mono_gc_inv); XFreeGC (display, gc_inv); @@ -2894,6 +2889,13 @@ main (int argc, char **argv) XtDestroyWidget (ShellWidget); XtDestroyApplicationContext (context); + M17N_FINI (); + + free (fontset_name); + free (filename); + free (input_method_table); + free (InputMethodMenus); + exit (0); } #endif /* not FOR_DOXYGEN */ -- 1.7.10.4