Reset extra buffer slot if it is released
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 28 Oct 2014 10:33:52 +0000 (19:33 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 28 Oct 2014 10:33:52 +0000 (19:33 +0900)
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

src/virtual_window.c

index 8df96d7..6b34251 100644 (file)
@@ -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;
            }