From: handa Date: Fri, 14 Oct 2005 02:32:53 +0000 (+0000) Subject: (main): Don't leave a fontset unfreed. X-Git-Tag: REL-1-3-0~128 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=bca9190a8ad1eeacfbd4da160ba32e533d7aa894;p=m17n%2Fm17n-lib.git (main): Don't leave a fontset unfreed. --- diff --git a/example/medit.c b/example/medit.c index 9c33380..0b8a0db 100644 --- a/example/medit.c +++ b/example/medit.c @@ -1,5 +1,5 @@ /* medit.c -- simple multilingual editor. -*- coding: euc-jp; -*- - Copyright (C) 2003, 2004 + Copyright (C) 2003, 2004, 2005 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H15PRO112 @@ -2736,7 +2736,7 @@ main (int argc, char **argv) MFont *dev_font = mfont (); MFont *thai_font = mfont (); MFont *tib_font = mfont (); - MFontset *fontset; + MFontset *fontset, *fontset_no_ctl; MSymbol unicode_bmp = msymbol ("unicode-bmp"); MSymbol no_ctl = msymbol ("no-ctl"); @@ -2747,18 +2747,20 @@ main (int argc, char **argv) mfont_put_prop (tib_font, Mfamily, msymbol ("mtib")); mfont_put_prop (tib_font, Mregistry, unicode_bmp); - fontset = mfontset_copy (mfontset (fontset_name), "no-ctl"); - mfontset_modify_entry (fontset, msymbol ("latin"), Mnil, Mnil, + fontset = mfontset (fontset_name); + fontset_no_ctl = mfontset_copy (fontset, "no-ctl"); + m17n_object_unref (fontset); + mfontset_modify_entry (fontset_no_ctl, msymbol ("latin"), Mnil, Mnil, latin_font, Mnil, 0); - mfontset_modify_entry (fontset, msymbol ("devanagari"), Mnil, Mnil, + mfontset_modify_entry (fontset_no_ctl, msymbol ("devanagari"), Mnil, Mnil, dev_font, no_ctl, 0); - mfontset_modify_entry (fontset, msymbol ("thai"), Mnil, Mnil, + mfontset_modify_entry (fontset_no_ctl, msymbol ("thai"), Mnil, Mnil, thai_font, no_ctl, 0); - mfontset_modify_entry (fontset, msymbol ("tibetan"), Mnil, Mnil, + mfontset_modify_entry (fontset_no_ctl, msymbol ("tibetan"), Mnil, Mnil, tib_font, no_ctl, 0); face_no_ctl_fontset = mface (); - mface_put_prop (face_no_ctl_fontset, Mfontset, fontset); - m17n_object_unref (fontset); + mface_put_prop (face_no_ctl_fontset, Mfontset, fontset_no_ctl); + m17n_object_unref (fontset_no_ctl); free (dev_font); free (thai_font);