summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_surface.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-02-15 11:06:03 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-02-15 11:07:12 -0600
commitf80061e18442c16eb0663ef9d996db0b1d40cd9f (patch)
treeb115b2fce65516e4b2c9e00e6d31d1faa37f7fd4 /src/lib/ecore_wl2/ecore_wl2_surface.c
parent6f0d962f6787fed87785525f3c3bb107fd2fd6fd (diff)
ecore_wl2: Take a library reference on surface create
Since surface handling is now done via modules, we need to ensure the library can't be shutdown while a surface exists. Otherwise, we get a segfault trying to call a function we've unmapped. Fixes a bug on shutdown for some wayland clients using software rendering.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_surface.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_surface.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c
index a702f995a6..9e7512d090 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -20,6 +20,10 @@ ecore_wl2_surface_destroy(Ecore_Wl2_Surface *surface)
20 surface->wl2_win = NULL; 20 surface->wl2_win = NULL;
21 21
22 free(surface); 22 free(surface);
23 /* We took a reference to ecore_wl2 in surface create to prevent
24 * modules unloading with surfaces in flight. Release that now.
25 */
26 ecore_wl2_shutdown();
23} 27}
24 28
25EAPI void 29EAPI void
@@ -107,6 +111,11 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha)
107 ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_OFFSCREEN, 111 ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_OFFSCREEN,
108 _ecore_wl2_surface_cb_offscreen, 112 _ecore_wl2_surface_cb_offscreen,
109 out); 113 out);
114 /* Since we have loadable modules, we need to make sure this
115 * surface keeps ecore_wl2 from de-initting and dlclose()ing
116 * things until after it's destroyed
117 */
118 ecore_wl2_init();
110 return out; 119 return out;
111 } 120 }
112 } 121 }