Fixed errors detected by static anlaysis tool 27/79627/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 12 Jul 2016 06:03:19 +0000 (15:03 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Tue, 12 Jul 2016 07:03:32 +0000 (16:03 +0900)
Change-Id: I6bc0e28a8d9019147d516a22e5beaf607ea50fe9

scl/gwes/efl/sclgraphics-efl.cpp
scl/gwes/efl/sclwindows-efl.cpp
scl/sclcontext.cpp
scl/sclcontroller.cpp
scl/sclevents.cpp
scl/sclkeyfocushandler.cpp
scl/sclresourcecache.cpp
scl/scluibuilder.cpp
scl/scluiimpl.cpp

index f22b4c2..8fee354 100644 (file)
@@ -835,6 +835,7 @@ CSCLGraphicsImplEfl::get_image_size(sclchar* image_path)
     SclSize ret = { 0, 0 };
 
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return ret;
 
     Evas_Object *window_object = (Evas_Object*)(windows->get_base_window());
     Evas_Object *image_object = NULL;
index d1fec90..7783c76 100644 (file)
@@ -246,16 +246,18 @@ CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowCon
 
     set_window_accepts_focus(win, FALSE);
 
-    int rots[4] = {0, 90, 180, 270};
+    int rots[4] = { 0, 90, 180, 270 };
     elm_win_wm_rotation_available_rotations_set(win, rots, 4);
 
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
     CSCLUtils *utils = CSCLUtils::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
     sclint scrx, scry, winx, winy;
-    utils->get_screen_resolution(&scrx, &scry);
-    SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
-    evas_object_resize(win, scrx, height + window_context->height);
+    if (windows && utils) {
+        utils->get_screen_resolution(&scrx, &scry);
+        SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+        if (window_context) evas_object_resize(win, scrx, height + window_context->height);
+    }
 #endif
 
 #ifdef WAYLAND
@@ -771,6 +773,8 @@ CSCLWindowsImplEfl::resize_window(const sclwindow window, scl16 width, scl16 hei
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLUtils *utils = CSCLUtils::get_instance();
 
+    if (!windows || !utils) return;
+
 #ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
     if (window == windows->get_magnifier_window()) {
         SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
@@ -1117,6 +1121,8 @@ void release_all(Evas_Object *win)
     //LOGD("HIDE_WINDOW : %p\n", window);
 
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return;
+
     SclWindowContext *window_context = windows->get_window_context(win);
         if (window_context && win) {
             if (window_context->etc_info) {
index b98b513..919bbb6 100644 (file)
@@ -97,7 +97,10 @@ CSCLContext::get_popup_layout(sclwindow window) const
     SCL_DEBUG();
 
     sclshort ret = NOT_USED;
+
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return ret;
+
     //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
     SclWindowContext *window_context = windows->get_window_context(window);
 
@@ -114,6 +117,8 @@ CSCLContext::set_popup_layout(sclwindow window, sclshort val)
     SCL_DEBUG();
 
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return;
+
     //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
     SclWindowContext *window_context = windows->get_window_context(window);
 
@@ -126,7 +131,10 @@ void
 CSCLContext::set_base_layout(sclshort val)
 {
     SCL_DEBUG();
+
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return;
+
     //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
     SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
     if (window_context) {
@@ -140,7 +148,10 @@ CSCLContext::get_base_layout() const
     SCL_DEBUG();
 
     sclshort ret = NOT_USED;
+
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return ret;
+
     //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
     SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
     if (window_context) {
index f0fbf4a..eb59745 100644 (file)
@@ -48,6 +48,8 @@ _play_tts_for_input_mode_name(int mode) {
     }
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return FALSE;
+
     const SclInputModeConfigure *pinput_mode_table = sclres_manager->get_input_mode_configure_table();
     if (NULL == pinput_mode_table) {
         return FALSE;
@@ -200,8 +202,11 @@ CSCLController::process_input_mode_change(const sclbyte mode)
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if(!utils || !context || !windows || !cache || !sclres_manager) return FALSE;
+
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
-    assert(sclres_input_mode_configure != NULL);
+    if (!sclres_input_mode_configure) return FALSE;
 
     if (context && windows && cache && utils) {
         if (mode == context->get_input_mode() || mode == (sclbyte)NOT_USED) {
@@ -282,8 +287,11 @@ CSCLController::process_rotation_change(const SCLRotation rotation)
     CSCLContext *context = CSCLContext::get_instance();
     CSCLWindows *windows = CSCLWindows::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if (!sclres_manager) return FALSE;
+
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
-    assert(sclres_input_mode_configure != NULL);
+    if (!sclres_input_mode_configure) return FALSE;
 
     if (context && windows) {
         SCLDisplayMode mode;
@@ -395,10 +403,12 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
     CSCLFeedback *feedback = CSCLFeedback::get_instance();
     CSCLEventHandler *handler = CSCLEventHandler::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if (!sclres_manager) return FALSE;
+
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
     PSclLayout sclres_layout = sclres_manager->get_layout_table();
-    assert(sclres_input_mode_configure != NULL);
-    assert(sclres_layout != NULL);
+    if (!sclres_input_mode_configure || !sclres_layout) return FALSE;
 
     SclButtonContext *button_context = NULL;
     const SclLayoutKeyCoordinate *coordinate = NULL;
@@ -752,11 +762,14 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     CSCLEventHandler *handler = CSCLEventHandler::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if (!sclres_manager) return FALSE;
+
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
     PSclLayout sclres_layout = sclres_manager->get_layout_table();
 
-    assert(sclres_input_mode_configure != NULL);
-    assert(sclres_layout != NULL);
+    if (!sclres_input_mode_configure || !sclres_layout) return FALSE;
+
     if (context && cache && handler && windows && state) {
         const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
         SclButtonContext *button_context = cache->get_cur_button_context(window, key_index);
@@ -1552,10 +1565,12 @@ CSCLController::process_button_release_event(sclwindow window, sclint x, sclint
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return FALSE;
+
     PSclLayout sclres_layout = sclres_manager->get_layout_table();
     PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
-    assert(sclres_layout != NULL);
-    assert(sclres_input_mode_configure != NULL);
+    if (!sclres_layout || !sclres_input_mode_configure) return FALSE;
+
     SclButtonContext *button_context = NULL;
     const SclLayoutKeyCoordinate *coordinate = NULL;
 
@@ -2736,8 +2751,11 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
     CSCLUtils *utils = CSCLUtils::get_instance();
     CSCLEventHandler *handler = CSCLEventHandler::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if (!sclres_manager) return FALSE;
+
     PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
-    assert(sclres_modifier_decoration != NULL);
+    if (!sclres_modifier_decoration) return FALSE;
 
     if (cache && state && windows && context && utils && adjustment && sclres_manager) {
         const SclLayout *layout = cache->get_cur_layout(window);
@@ -3642,6 +3660,8 @@ void CSCLController::handle_engine_signal(SclInternalSignal signal, sclwindow ta
     CSCLImageProxy *proxy = CSCLImageProxy::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
 
+    if (!events || !windows || !context || !proxy || !cache) return;
+
     switch (signal) {
         case SCL_SIG_SHOW:
             {
index c0caf34..8c221fe 100644 (file)
@@ -91,6 +91,8 @@ void
 CSCLEvents::connect_window_events(sclwindow wnd, const sclint evt )
 {
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return;
+
     //SclWindowContext *window_context = windows->get_window_context(wnd, FALSE);
     SclWindowContext *window_context = windows->get_window_context(wnd);
     if (window_context) {
@@ -130,6 +132,8 @@ CSCLEvents::process_key_event(const char *key)
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
 
+    if (!windows || !focus_handler || !cache || !controller) return FALSE;
+
     sclwindow current_focus_window = focus_handler->get_current_focus_window();
     scl8 current_key_index = focus_handler->get_current_focus_key();
     sclwindow focus_window = current_focus_window;
index 4729c79..405a0b4 100644 (file)
@@ -133,7 +133,7 @@ CSCLKeyFocusHandler::popup_closed(sclwindow window)
         sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
         layout = context->get_popup_layout(m_focus_window);
     }
-    if (sclres_layout_key_coordinate_pointer_frame &&
+    if (windows && sclres_layout_key_coordinate_pointer_frame &&
         scl_check_arrindex(layout, MAX_SCL_LAYOUT) && scl_check_arrindex(m_focus_key, MAX_KEY)) {
             SclLayoutKeyCoordinatePointer cur = sclres_layout_key_coordinate_pointer_frame[layout][m_focus_key];
             SclWindowContext *window_context = windows->get_window_context(m_focus_window);
@@ -274,7 +274,8 @@ CSCLKeyFocusHandler::get_next_candidate_key(SCLHighlightNavigationDirection dire
             layout = context->get_popup_layout(window);
         }
     }
-    if (sclres_layout_key_coordinate_pointer_frame && cache && context && scl_check_arrindex(layout, MAX_SCL_LAYOUT)) {
+    if (windows && cache && context &&
+        sclres_layout_key_coordinate_pointer_frame && scl_check_arrindex(layout, MAX_SCL_LAYOUT)) {
         for (sclint loop = 0;loop < MAX_KEY; loop++) {
             SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop];
             if (p && (loop != m_focus_key || window != m_focus_window)) {
index 1c691e2..a3e2e1d 100644 (file)
@@ -808,6 +808,8 @@ CSCLResourceCache::remove_private_key(sclint id)
     sclshort layout =  context->get_base_layout();
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return FALSE;
+
     PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame =
         sclres_manager->get_key_coordinate_pointer_frame();
 
@@ -868,17 +870,18 @@ CSCLResourceCache::recompute_layout(sclwindow window)
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLContext *context = CSCLContext::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!windows || !context || !utils || !sclres_manager) return FALSE;
+
     const PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
     const PSclLayout sclres_layout = sclres_manager->get_layout_table();
     const PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame =
         sclres_manager->get_key_coordinate_pointer_frame();
     const PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
     const PSclLabelPropertiesTable sclres_label_properties = sclres_manager->get_label_properties_frame();
-    assert(sclres_input_mode_configure != NULL);
-    assert(sclres_layout != NULL);
-    assert(sclres_layout_key_coordinate_pointer_frame != NULL);
-    assert(sclres_modifier_decoration != NULL);
-    assert(sclres_label_properties != NULL);
+
+    if (!sclres_input_mode_configure || !sclres_layout || !sclres_layout_key_coordinate_pointer_frame ||
+        !sclres_modifier_decoration || !sclres_label_properties)
+        return FALSE;
 
     /* FIXME */
     scl8 popupindex = NOT_USED;
@@ -1064,6 +1067,8 @@ CSCLResourceCache::get_cur_layout_key_coordinate(sclwindow window, sclbyte key_i
     scl_assert_return_null(key_index < MAX_KEY);
 
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return NULL;
+
     if (windows->get_base_window() == window) {
         if (key_index < MAX_KEY) {
             return &mCurBaseLayoutKeyCoordinates[key_index];
@@ -1089,6 +1094,8 @@ CSCLResourceCache::get_label_properties(sclchar *label_type, sclbyte index) cons
     SCL_DEBUG();
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return NULL;
+
     PSclLabelPropertiesTable sclres_label_properties = sclres_manager->get_label_properties_frame();
     assert(sclres_label_properties != NULL);
     if (sclres_label_properties && label_type) {
@@ -1125,6 +1132,8 @@ CSCLResourceCache::get_cur_button_context(sclwindow window, sclbyte key_index)
     scl_assert_return_null(key_index < MAX_KEY);
 
     CSCLWindows *windows = CSCLWindows::get_instance();
+    if (!windows) return NULL;
+
     if (windows->get_base_window() == window) {
         if (key_index < MAX_KEY) {
             return &mCurBaseButtonContext[key_index];
@@ -1439,6 +1448,8 @@ void
 CSCLResourceCache::clone_keyproperties(SclPrivateKeyProperties* priv, sclbyte input_mode_index, sclbyte layout_index, sclbyte key_index)
 {
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return;
+
     const PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
 
     SCL_DEBUG();
@@ -1513,6 +1524,8 @@ CSCLResourceCache::set_private_key(const sclchar* custom_id, sclchar* label, scl
     clear_privatekeyproperties(&privProperties);
 
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!sclres_manager) return NOT_USED;
+
     PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame = sclres_manager->get_key_coordinate_pointer_frame();
     assert(sclres_layout_key_coordinate_pointer_frame != NULL);
 
@@ -1597,14 +1610,18 @@ void CSCLResourceCache::enable_button(const sclchar *custom_id, sclboolean enabl
 {
     SCL_DEBUG();
 
+    CSCLWindows *windows = CSCLWindows::get_instance();
+    CSCLContext *context = CSCLContext::get_instance();
+    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+    if (!windows || !context || !sclres_manager) return;
+
     sclint loop;
     if (custom_id) {
         sclbyte layout_index = NOT_USED;
-        CSCLContext *context = CSCLContext::get_instance();
-        SclResParserManager *sclres_manager = SclResParserManager::get_instance();
         PSclLayoutKeyCoordinatePointerTable sclres_layout_key_coordinate_pointer_frame =
             sclres_manager->get_key_coordinate_pointer_frame();
-        assert(sclres_layout_key_coordinate_pointer_frame != NULL);
+        if(!sclres_layout_key_coordinate_pointer_frame) return;
 
         if (context) {
             layout_index = context->get_base_layout();
@@ -1626,9 +1643,10 @@ void CSCLResourceCache::enable_button(const sclchar *custom_id, sclboolean enabl
             }
         }
 
-        CSCLWindows *windows = CSCLWindows::get_instance();
         /* Fix me (we should decide by which way we would redraw the button's region - direct or indirect?)*/
-        windows->update_window(windows->get_base_window());
+        if (windows) {
+            windows->update_window(windows->get_base_window());
+        }
 
         sclboolean found = FALSE;
         sclint empty_index = -1;
index c8e3dc1..c29dfd1 100644 (file)
@@ -75,7 +75,7 @@ CSCLUIBuilder::init(sclwindow parent)
 
     PSclDefaultConfigure default_configure = NULL;
     PSclMagnifierWndConfigure magnifier_configure = NULL;
-    if (sclres_manager) {
+    if (m_gwes && m_utils && sclres_manager) {
         PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
         PSclLayout sclres_layout = sclres_manager->get_layout_table();
 
@@ -117,23 +117,29 @@ CSCLUIBuilder::init(sclwindow parent)
         }
 
         CSCLResourceCache *cache = CSCLResourceCache::get_instance();
-        sclwindow window = m_gwes->m_windows->get_base_window();
+        sclwindow window = SCLWINDOW_INVALID;
+        if (m_gwes->m_windows)
+            window = m_gwes->m_windows->get_base_window();
+
         if (cache)
             cache->recompute_layout(window);
 
         /* Creates the magnifier window */
         if (default_configure && magnifier_configure) {
             if (default_configure->use_magnifier_window) {
-                sclwindow magnifier_window = m_gwes->m_windows->create_magnifier_window(parent, 0, 0,
-                    magnifier_configure->width, magnifier_configure->height);
-                m_gwes->m_events->connect_window_events(magnifier_window, SCL_EVENT_EXPOSE | SCL_EVENT_MOUSE);
+                if (m_gwes->m_windows && m_gwes->m_events) {
+                    sclwindow magnifier_window = m_gwes->m_windows->create_magnifier_window(parent, 0, 0,
+                        magnifier_configure->width, magnifier_configure->height);
+                    m_gwes->m_events->connect_window_events(magnifier_window, SCL_EVENT_EXPOSE | SCL_EVENT_MOUSE);
+                }
             }
         }
 
         /* Creates the dim window */
         /* FIXME */
         //if (scl_check_arrindex(defaultLayoutIdx, MAX_LAYOUT)) {
-        m_gwes->m_windows->create_dim_window(window, NULL, sclres_layout[layout].width, sclres_layout[layout].height);
+        if (m_gwes->m_windows)
+            m_gwes->m_windows->create_dim_window(window, NULL, sclres_layout[layout].width, sclres_layout[layout].height);
 
         /* m_gwes->m_events->set_touch_event_offset(scl_default_configure.touch_offset);*/
         /*Moved to Show Layout*/
@@ -450,14 +456,15 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c
     CSCLGraphics *graphics = CSCLGraphics::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     const SclLayoutKeyCoordinate* coordinate = NULL;
-    if (cache)
-        coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
 
-    scl_assert_return_false(window);
-    scl_assert_return_false(draw_ctx);
-    scl_assert_return_false(coordinate);
+    if (!utils || !windows || !graphics || !cache) return FALSE;
+
+    coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+    if (coordinate) {
+        scl_assert_return_false(window);
+        scl_assert_return_false(draw_ctx);
+        scl_assert_return_false(coordinate);
 
-    if (utils && windows && graphics && cache && coordinate) {
         /* If the target window is virtual window, let's draw it on the base window */
         sclint targetaddx = 0;
         sclint targetaddy = 0;
@@ -749,11 +756,14 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr
     CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLGraphics *graphics = CSCLGraphics::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
     const SclLayoutKeyCoordinate* coordinate = NULL;
-    if (cache)
-        coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
 
-    SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+    if (!context || !windows || !graphics || !cache || !sclres_manager) return FALSE;
+
+    coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+
     PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
     assert(sclres_modifier_decoration != NULL);
     scl_assert_return_false(window);
@@ -763,7 +773,7 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr
 
     sclchar composed_path[_POSIX_PATH_MAX] = {0, };
 
-    if (context && graphics && cache && coordinate) {
+    if (context && windows && graphics && cache && coordinate) {
         sclboolean path_composed = FALSE;
         /* Check if we need to decorate the button's drag state */
         //if (context->get_cur_drag_state(context->get_last_touch_device_id()) != SCL_DRAG_STATE_NONE &&
@@ -857,10 +867,11 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
     SCL_DEBUG();
 
     CSCLContext *context = CSCLContext::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
     SclResParserManager *sclres_manager = SclResParserManager::get_instance();
 
-    if (!context || !cache || !sclres_manager) return FALSE;
+    if (!context || !windows || !cache || !sclres_manager) return FALSE;
 
     const SclLayout* layout = cache->get_cur_layout(window);
     const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
@@ -872,7 +883,6 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw
 
     scl_assert_return_false(state >= BUTTON_STATE_NORMAL && state < SCL_BUTTON_STATE_MAX);
 
-    CSCLWindows *windows = CSCLWindows::get_instance();
     //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
     SclWindowContext *window_context = windows->get_window_context(window);
 
@@ -973,8 +983,10 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
     CSCLUtils *utils = CSCLUtils::get_instance();
     CSCLContext *context = CSCLContext::get_instance();
     CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+    CSCLActionState *state = CSCLActionState::get_instance();
+    CSCLWindows *windows = CSCLWindows::get_instance();
 
-    if (!utils || !context || !cache) return FALSE;
+    if (!utils || !context || !cache || !state || !windows) return FALSE;
 
     sclwindow pressed_window = context->get_cur_pressed_window(context->get_last_touch_device_id());
     scl8 pressed_key = context->get_cur_pressed_key(context->get_last_touch_device_id());
@@ -990,8 +1002,6 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
         return TRUE;
     }
 
-    CSCLActionState *state = CSCLActionState::get_instance();
-    CSCLWindows *windows = CSCLWindows::get_instance();
     const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
     SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
     SclButtonContext* button_context = cache->get_cur_button_context(pressed_window, pressed_key);
@@ -1174,7 +1184,7 @@ CSCLUIBuilder::draw_magnifier_label(const sclwindow window, const scldrawctx dra
         magnifier_configure = sclres_manager->get_magnifier_configure();
     }
 
-    if (utils && windows && cache && context && magnifier_configure) {
+    if (utils && windows && cache && context && graphics && magnifier_configure) {
         const SclLabelProperties *labelproperties = NULL;
         if (scl_check_arrindex(label_index, MAX_SIZE_OF_LABEL_FOR_ONE)) {
             labelproperties = cache->get_label_properties(magnifier_configure->label_type, label_index);
index 809ccfc..28c4af0 100644 (file)
@@ -1011,7 +1011,7 @@ CSCLUIImpl::enable_highlight_ui(sclboolean enabled)
     if (m_initialized) {
         CSCLContext *context = CSCLContext::get_instance();
         CSCLWindows *windows = CSCLWindows::get_instance();
-        if (context) {
+        if (context && windows) {
             context->set_highlight_ui_enabled(enabled);
 
             sclwindow window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);