From: handa Date: Tue, 20 Jul 2004 02:30:29 +0000 (+0000) Subject: (main): If frame creation is falied, exit by error. X-Git-Tag: REL-1-1-0~91 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a38cb62ffc29ec9fb74628e8850ac801aef9f548;p=m17n%2Fm17n-lib.git (main): If frame creation is falied, exit by error. Call M17N_FINI after destroying the application context. --- 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 */