summaryrefslogtreecommitdiff
path: root/components/rtgui/common
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2011-08-16 08:19:57 +0000
committerbernard.xiong <[email protected]>2011-08-16 08:19:57 +0000
commit2e6e01550ed312dba19c77cfc686e552ec432748 (patch)
tree77c96a6ed06025b8bab37210833f380bb9788b4b /components/rtgui/common
parenta8f51bf63ad61c3b249547de5596c0f71c6c60fd (diff)
fixed hz font derefer issue
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1671 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/common')
-rw-r--r--components/rtgui/common/font_bmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/rtgui/common/font_bmp.c b/components/rtgui/common/font_bmp.c
index 497e5b0a09..e897cedb6d 100644
--- a/components/rtgui/common/font_bmp.c
+++ b/components/rtgui/common/font_bmp.c
@@ -94,8 +94,7 @@ static void rtgui_bitmap_font_draw_text(struct rtgui_font* font, struct rtgui_dc
while ((rt_uint8_t)*(text + length) >= 0x80) length ++; /* it's not a ascii character */
if (length > 0)
{
- if (hz_font != RT_NULL)
- rtgui_font_draw(hz_font, dc, text, length, rect);
+ if (hz_font != RT_NULL) rtgui_font_draw(hz_font, dc, text, length, rect);
text += length;
len -= length;
}
@@ -119,7 +118,8 @@ static void rtgui_bitmap_font_draw_text(struct rtgui_font* font, struct rtgui_dc
}
}
- rtgui_font_derefer(hz_font);
+ if (hz_font != RT_NULL) rtgui_font_derefer(hz_font);
+
#else
while ((rect->x1 < rect->x2) && len)
{