From 2d98c0e7be8e0803de4b4e8e9ba03635bcef91c8 Mon Sep 17 00:00:00 2001 From: yangfasheng Date: Tue, 12 Dec 2017 19:46:38 +0800 Subject: gui 引擎代码更新; MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/gui/src/image_container.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'components/gui/src/image_container.c') diff --git a/components/gui/src/image_container.c b/components/gui/src/image_container.c index 66b7191271..f86300c6ef 100644 --- a/components/gui/src/image_container.c +++ b/components/gui/src/image_container.c @@ -393,13 +393,18 @@ rtgui_image_item_t *rtgui_image_container_get(const char *filename) if (item == RT_NULL) { item = (struct rtgui_image_item *) rtgui_malloc(sizeof(struct rtgui_image_item)); - if (item == RT_NULL) return RT_NULL; + if (item == RT_NULL) + { + rt_mutex_release(&_image_hash_lock); + return RT_NULL; + } /* create a image object */ item->image = rtgui_image_create(filename, RT_TRUE); if (item->image == RT_NULL) { rtgui_free(item); + rt_mutex_release(&_image_hash_lock); return RT_NULL; /* create image failed */ } item->refcount = 1; -- cgit v1.3.1