diff options
author | Chris Michael <cp.michael@samsung.com> | 2014-12-01 13:45:23 -0500 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2014-12-01 13:45:23 -0500 |
commit | 728833ed43c562d2dcd57a585e8819d35a34bc71 (patch) | |
tree | 12128f23afb4ce006f6280e97fc582c0d3fde3d8 /src/lib/ecore_wayland/ecore_wl_window.c | |
parent | 5244ad1f8dbdd038bafab060282dc6346d1f613a (diff) |
ecore-wayland: Add safety check for window surface creation
Summary: We cannot call wl_proxy_get_id if the surface creation failed
else that would lead to an abort in the wayland libraries. This commit
adds a safety check
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_window.c')
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_window.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 63c870f673..5fe64102cb 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c | |||
@@ -261,7 +261,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in | |||
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||
264 | EAPI struct wl_surface* | 264 | EAPI struct wl_surface * |
265 | ecore_wl_window_surface_create(Ecore_Wl_Window *win) | 265 | ecore_wl_window_surface_create(Ecore_Wl_Window *win) |
266 | { | 266 | { |
267 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | 267 | LOGFN(__FILE__, __LINE__, __FUNCTION__); |
@@ -269,6 +269,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win) | |||
269 | if (!win) return NULL; | 269 | if (!win) return NULL; |
270 | if (win->surface) return win->surface; | 270 | if (win->surface) return win->surface; |
271 | win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get()); | 271 | win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get()); |
272 | if (!win->surface) return NULL; | ||
272 | win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface); | 273 | win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface); |
273 | return win->surface; | 274 | return win->surface; |
274 | } | 275 | } |