tdm_buffer: clean up tdm_buffer_unref_backend() 54/100454/2
authorYoungJun Cho <yj44.cho@samsung.com>
Mon, 28 Nov 2016 07:23:08 +0000 (16:23 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 28 Nov 2016 08:33:10 +0000 (00:33 -0800)
This patch cleans up tdm_buffer_unref_backend().
The 'buffer' is not changed in buf_info->release_funcs list loop,
so does not need to call ref & unref inside.

Change-Id: I924bc4abde130be37ee800534e161beee56ae09a
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
src/tdm_buffer.c

index 8e9f10a01822c3fd3b61850021e0190cdeb4d02a..4fa18a386b8797ab9c738ad8f55999a2c75e189c 100644 (file)
@@ -220,11 +220,10 @@ tdm_buffer_unref_backend(tbm_surface_h buffer)
 //     if (!tdm_thread_in_display_thread(syscall(SYS_gettid)))
 //             TDM_NEVER_GET_HERE();
 
-       LIST_FOR_EACH_ENTRY_SAFE(func_info, next, &buf_info->release_funcs, link) {
-               tbm_surface_internal_ref(buffer);
+       tbm_surface_internal_ref(buffer);
+       LIST_FOR_EACH_ENTRY_SAFE(func_info, next, &buf_info->release_funcs, link)
                func_info->release_func(buffer, func_info->user_data);
-               tbm_surface_internal_unref(buffer);
-       }
+       tbm_surface_internal_unref(buffer);
 
        tbm_surface_internal_unref(buffer);
 }