yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=cf94c16a89a6fe2f4edf5267079b079961e6fcee

commit cf94c16a89a6fe2f4edf5267079b079961e6fcee
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Sun Nov 15 14:11:39 2015 +0200

    Updater: add initialize checks
---
 src/lib/updater.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/lib/updater.c b/src/lib/updater.c
index c41b970..c9a5a90 100644
--- a/src/lib/updater.c
+++ b/src/lib/updater.c
@@ -29,6 +29,11 @@ typedef struct _force_info
 void
 updater_session_add(Gui_Context *ctx, const Gui_Session *session)
 {
+   if (!_init_counter)
+     {
+        ERR("Updater module was not initialized");
+        return;
+     }
    Eina_List *sessions = gui_context_data_get(ctx, SESSIONS_DATA_KEY);
    sessions = eina_list_append(sessions, session);
    gui_context_data_set(ctx, SESSIONS_DATA_KEY, sessions);
@@ -37,12 +42,22 @@ updater_session_add(Gui_Context *ctx, const Gui_Session 
*session)
 void
 updater_wake(const Gui_Context *ctx)
 {
+   if (!_init_counter)
+     {
+        ERR("Updater module was not initialized");
+        return;
+     }
    _ctxs_to_update = eina_list_append(_ctxs_to_update, ctx);
 }
 
 void
 updater_force(Eid *eid, Updater_Force_Type type)
 {
+   if (!_init_counter)
+     {
+        ERR("Updater module was not initialized");
+        return;
+     }
    Gui_Widget *wdg = wdg_get(eid);
    if (!wdg) return;
    Gui_Context *ctx = (Gui_Context *)wdg_context_get(wdg);
@@ -58,6 +73,11 @@ updater_force(Eid *eid, Updater_Force_Type type)
 void
 updater_completion_callback_add(Updater_Completion_Cb cb, void *data)
 {
+   if (!_init_counter)
+     {
+        ERR("Updater module was not initialized");
+        return;
+     }
    Completion_Info *info = calloc(1, sizeof(*info));
    info->cb = cb;
    info->data = data;

-- 


Reply via email to