From: Sung-jae Park Date: Tue, 28 Oct 2014 10:33:52 +0000 (+0900) Subject: Reset extra buffer slot if it is released X-Git-Tag: accepted/tizen/mobile/20150530.065423^2~18^2~13^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=588868143b4f68180f853f1977ecbef329c42509;p=apps%2Fnative%2Fwidget%2Fwidget.git Reset extra buffer slot if it is released To reuse it again [model] Redwood,Kiran,B3(Wearable) [binary_type] AP [customer] Docomo/Orange/ATT/Open [issue#] N/A [problem] [cause] [solution] [team] HomeTF [request] [horizontal_expansion] Change-Id: Idc514793b00916f8a04e4bfa1b8638b75a37368e --- diff --git a/src/virtual_window.c b/src/virtual_window.c index 8df96d7..6b34251 100644 --- a/src/virtual_window.c +++ b/src/virtual_window.c @@ -533,7 +533,7 @@ static Ecore_X_Pixmap alloc_pixmap_cb(void *data, Ecore_X_Window parent, int w, int idx; if (!info->resource_array) { - info->resource_array = calloc(sizeof(*info->resource_array), DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT); + info->resource_array = calloc(DYNAMICBOX_CONF_EXTRA_BUFFER_COUNT, sizeof(*info->resource_array)); if (!info->resource_array) { ErrPrint("Out of memory: %s\n", strerror(errno)); return 0u; @@ -599,6 +599,7 @@ static void free_pixmap_cb(void *data, Ecore_X_Pixmap pixmap) if (dynamicbox_release_extra_buffer(info->handle, idx) < 0) { DbgPrint("Failed to release buffer\n"); } + info->resource_array[idx] = 0u; info->resource_cnt--; break; }