ecore-x: Add EINA_SAFETY checks for missing display

xlib immediately crashes upon being passed a null DISPLAY object,
so every function in ecore-x should likely have safety checks such
as these.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2016-02-12 08:25:20 -05:00
parent bcbf5df8b3
commit eb11b7f26e
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
int hot_x,
int hot_y)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
#ifdef ECORE_XCURSOR
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@ -233,6 +234,7 @@ ecore_x_cursor_shape_get(int shape)
{
Ecore_X_Cursor cur;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, 0);
/* Shapes are defined in Ecore_X_Cursor.h */
cur = XCreateFontCursor(_ecore_x_disp, shape);
if (_ecore_xlib_sync) ecore_x_sync();