summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-01-14 11:48:18 +0000
committerManolo Gouy <Manolo>2011-01-14 11:48:18 +0000
commit1a0b262f992c774abc062356ded48082ed70fdf2 (patch)
tree6d794721c2b15c901bf65f7d1d943dc20e37d388 /src
parent728b46535baa075112405fa6136ac98c3ccc4426 (diff)
Fix memory leak in fl_new_ic() reported by Denton Thomas.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8277 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_x.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index e981faa93..1de3b3cf2 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -363,7 +363,6 @@ void fl_new_ic()
XVaNestedList status_attr = NULL;
static XFontSet fs = NULL;
char *fnt;
- bool must_free_fnt = true;
char **missing_list;
int missing_count;
char *def_string;
@@ -379,17 +378,18 @@ void fl_new_ic()
#endif /*__GNUC__*/
if (!fs) {
- fnt = NULL;//fl_get_font_xfld(0, 14);
- if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
+ fnt = (char*)"-misc-fixed-*";
fs = XCreateFontSet(fl_display, fnt, &missing_list,
&missing_count, &def_string);
}
#else
if (!fs) {
+ bool must_free_fnt = true;
fnt = fl_get_font_xfld(0, 14);
if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
fs = XCreateFontSet(fl_display, fnt, &missing_list,
&missing_count, &def_string);
+ if (must_free_fnt) free(fnt);
}
#endif
preedit_attr = XVaCreateNestedList(0,