Mercurial > pidgin
comparison src/gtkimhtml.c @ 2065:391440022697
[gaim-migrate @ 2075]
minor one-time leak
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 03 Jul 2001 19:08:48 +0000 |
parents | 3366311426df |
children | 0fd338304759 |
comparison
equal
deleted
inserted
replaced
2064:1f51e772a05c | 2065:391440022697 |
---|---|
1539 | 1539 |
1540 static gchar** | 1540 static gchar** |
1541 get_font_names () | 1541 get_font_names () |
1542 { | 1542 { |
1543 gint num_fonts = 0; | 1543 gint num_fonts = 0; |
1544 gchar **xfontnames = XListFonts (GDK_DISPLAY (), "-*", MAX_FONTS, &num_fonts); | 1544 gchar **xfontnames; |
1545 gchar **fonts = NULL; | 1545 static gchar **fonts = NULL; |
1546 gint i; | 1546 gint i; |
1547 | 1547 |
1548 if (!num_fonts) | 1548 if (fonts) |
1549 return fonts; | |
1550 | |
1551 xfontnames = XListFonts (GDK_DISPLAY (), "-*", MAX_FONTS, &num_fonts); | |
1552 | |
1553 if (!num_fonts) { | |
1554 XFreeFontNames(xfontnames); | |
1549 return g_new0 (char *, 1); | 1555 return g_new0 (char *, 1); |
1556 } | |
1550 | 1557 |
1551 fonts = g_new0 (char *, num_fonts + 1); | 1558 fonts = g_new0 (char *, num_fonts + 1); |
1552 | 1559 |
1553 for (i = 0; i < num_fonts; i++) { | 1560 for (i = 0; i < num_fonts; i++) { |
1554 gint countdown = 1, num_dashes = 1; | 1561 gint countdown = 1, num_dashes = 1; |
1564 break; | 1571 break; |
1565 | 1572 |
1566 fonts [i] = g_strndup (t1, (long) t2 - (long) t1); | 1573 fonts [i] = g_strndup (t1, (long) t2 - (long) t1); |
1567 } | 1574 } |
1568 | 1575 |
1576 XFreeFontNames(xfontnames); | |
1569 return fonts; | 1577 return fonts; |
1570 } | 1578 } |
1571 | 1579 |
1572 static GdkFont* | 1580 static GdkFont* |
1573 gtk_imhtml_font_load (GtkIMHtml *imhtml, | 1581 gtk_imhtml_font_load (GtkIMHtml *imhtml, |