[3.0]Change the location of checking NULL of mContext 80/76780/2
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 27 Jun 2016 08:13:10 +0000 (17:13 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 28 Jun 2016 07:32:10 +0000 (16:32 +0900)
- In devel/master branch, the patch already adjusted

Change-Id: If6e8b3441e44ba8df79b81277bc6af73702cfb99

adaptors/wayland/input/seat.cpp

index a8cab4f739f829364db4dc83dba817a1fdac1005..0de5ad56aa275b7bd55b47a3814a60ad7a50bec3 100644 (file)
@@ -224,6 +224,12 @@ void Seat::KeyboardKeymap( unsigned int format, int fd, unsigned int size )
     mXkbData.mContext = xkb_context_new( XKB_CONTEXT_NO_FLAGS );
   }
 
+  if( !mXkbData.mContext )
+  {
+    DALI_LOG_ERROR("xkb_context_new failed");
+    close(fd);
+    return;
+  }
   // current formats defined in wayland-client-protocol.h
   // WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP =0, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1=1
 
@@ -243,12 +249,6 @@ void Seat::KeyboardKeymap( unsigned int format, int fd, unsigned int size )
     return;
   }
 
-  if( !mXkbData.mContext )
-  {
-    DALI_LOG_ERROR("xkb_context_new failed");
-    close(fd);
-    return;
-  }
   mXkbData.mKeymap = xkb_map_new_from_string(mXkbData.mContext, map, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
 
   munmap(map, size);