FLTK logo

[Library] r8277 - branches/branch-1.3/src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r8277 - branches/branch-1.3/src fltk-dev Jan 14, 2011  
 
Author: manolo
Date: 2011-01-14 03:48:18 -0800 (Fri, 14 Jan 2011)
New Revision: 8277
Log:
Fix memory leak in fl_new_ic() reported by Denton Thomas.

Modified:
   branches/branch-1.3/src/Fl_x.cxx

Modified: branches/branch-1.3/src/Fl_x.cxx
===================================================================
--- branches/branch-1.3/src/Fl_x.cxx	2011-01-13 22:32:38 UTC (rev 8276)
+++ branches/branch-1.3/src/Fl_x.cxx	2011-01-14 11:48:18 UTC (rev 8277)
@@ -363,7 +363,6 @@
   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 @@
 #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,

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.