e: Fix connman wizard page
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>
Sat, 5 Jan 2013 03:55:16 +0000 (03:55 +0000)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 5 Jan 2013 03:55:16 +0000 (03:55 +0000)
It was unrefing connection inside of edbus_message callback.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 82258

src/modules/wizard/page_110.c

index fa39183..8a9a7b7 100644 (file)
@@ -63,17 +63,19 @@ _connman_fail(void *data)
      }
 
    e_config_save_queue();
-   if (pending_connman)
-     {
-        edbus_pending_cancel(pending_connman);
-        pending_connman = NULL;
-     }
 
    connman_timeout = NULL;
    _recommend_connman(pg);
    return EINA_FALSE;
 }
 
+static Eina_Bool
+_page_next_call(void *data EINA_UNUSED)
+{
+   e_wizard_next();
+   return ECORE_CALLBACK_CANCEL;
+}
+
 static void
 _check_connman_owner(void *data, const EDBus_Message *msg,
                      EDBus_Pending *pending __UNUSED__)
@@ -97,7 +99,7 @@ _check_connman_owner(void *data, const EDBus_Message *msg,
      goto fail;
 
    e_wizard_button_next_enable_set(1);
-   e_wizard_next();
+   ecore_idler_add(_page_next_call, NULL);
 
 fail:
    _connman_fail(data);
@@ -119,7 +121,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
 EAPI int
 wizard_page_show(E_Wizard_Page *pg)
 {
-   int have_connman = 0;
+   Eina_Bool have_connman = EINA_FALSE;
 
 #ifdef HAVE_ECONNMAN
    edbus_init();
@@ -132,20 +134,16 @@ wizard_page_show(E_Wizard_Page *pg)
 
         pending_connman = edbus_name_owner_get(conn, "net.connman",
                                                _check_connman_owner, pg);
-        if (pending_connman)
-          {
-             if (connman_timeout) ecore_timer_del(connman_timeout);
-             connman_timeout = ecore_timer_add(2.0, _connman_fail, pg);
-             have_connman = 1;
-             e_wizard_button_next_enable_set(0);
-          }
+        if (connman_timeout)
+          ecore_timer_del(connman_timeout);
+        connman_timeout = ecore_timer_add(2.0, _connman_fail, pg);
+        have_connman = EINA_TRUE;
+        e_wizard_button_next_enable_set(0);
      }
    if (!have_connman)
      {
         E_Config_Module *em;
         Eina_List *l;
-
-        edbus_shutdown();
         EINA_LIST_FOREACH(e_config->modules, l, em)
           {
              if (!em->name) continue;
@@ -180,6 +178,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
      }
    if (conn)
      edbus_connection_unref(conn);
+   conn = NULL;
 
 #ifdef HAVE_ECONNMAN
    edbus_shutdown();