Looking at the cleanup function, its only callers are the functions listed
in this commit message. There's no reason I can see why the free and
destroy/disconnect shouldn't be in the cleanup function in order to clarify
the code.

On Mon, Dec 7, 2015, 10:02 AM Christopher Michael <[email protected]>
wrote:

> devilhorns pushed a commit to branch master.
>
>
> http://git.enlightenment.org/core/efl.git/commit/?id=8287202c43e07c3363853406df4a07fca7409397
>
> commit 8287202c43e07c3363853406df4a07fca7409397
> Author: Chris Michael <[email protected]>
> Date:   Mon Dec 7 10:00:23 2015 -0500
>
>     ecore-wl2: Don't free display structure during display cleanup function
>
>     Due to reference caching, we cannot free the display structure here
>     yet. During calls to ecore_wl2_display_destroy (or others), if the
>     number of references reaches zero, then we end up calling
>     wl_display_destroy (or equivelant). If we free our display structure
>     during cleanup function, then calls to wl_display_destroy will cause a
>     segfault as our display->wayland_display has already been freed from
>     the structure
>
>     @fix
>
>     Signed-off-by: Chris Michael <[email protected]>
> ---
>  src/lib/ecore_wl2/ecore_wl2_display.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c
> b/src/lib/ecore_wl2/ecore_wl2_display.c
> index 289485b..6f5abfb 100644
> --- a/src/lib/ecore_wl2/ecore_wl2_display.c
> +++ b/src/lib/ecore_wl2/ecore_wl2_display.c
> @@ -363,7 +363,6 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
>     eina_hash_del_by_key(_client_displays, ewd->name);
>
>     free(ewd->name);
> -   free(ewd);
>  }
>
>  Ecore_Wl2_Window *
>
> --
>
>
>
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to