Changeset 3705

Show
Ignore:
Timestamp:
06/25/08 10:33:36
Author:
jdapena
Message:

* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c:

        • Don't set in_idle to false so that join works properly.
        • On disconnecting we forze a stop_idle so we warrant idle
          thread has died when we disconnect.
        • Send let idle die commands on disconnecting.
        • It's very important to make the idle thread die on time as it
          keeps a reference to the folder. Folder keeps a reference to
          this store, and then store should finish idle soon to be able
          to finalize (cycle reference).

* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c:

        • On finishing the idle thread we state we're out of it.

* libtinymail-camel/camel-lite/camel.c:

        • Avoid running internal methods of camel_shutdown two times if
          we can call shutdown two times.

* libtinymail-camel/tny-session-camel.c:

* libtinymail-camel/tny-camel-store-account.c:

        • Free the iter store reference on finalising.

* libtinymail-camel/tny-camel-account.c:

        • Set service to null after unreffing it.

* libtinymailui-gtk/tny-gtk-folder-store-tree-model.c:

        • Don't get folders again when we change status to disconnected.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/camel-lite/camel/camel.c

    r3365 r3705  
    5555                return; 
    5656 
     57        initialised = FALSE; 
    5758        certdb = camel_certdb_get_default (); 
    5859        if (certdb) { 
     
    6667#endif /* HAVE_NSS */ 
    6768 
    68         initialised = FALSE; 
    6969} 
    7070 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c

    r3687 r3705  
    42214221        } 
    42224222 
     4223        store->in_idle = FALSE; 
    42234224        camel_object_unref (folder); 
    42244225 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r3698 r3705  
    235235                CAMEL_SERVICE_REC_LOCK (store, connect_lock); 
    236236                nwritten = camel_stream_printf (store->ostream, "DONE\r\n"); 
    237                 store->in_idle = FALSE; 
    238237                if (nwritten != -1) { 
    239238                        resp = NULL; 
     
    397396 
    398397        let_idle_die (imap_store, TRUE); 
     398 
     399        camel_imap_store_stop_idle (imap_store); 
    399400 
    400401        if (imap_store->current_folder) { 
     
    21012102        imap_debug ("imap_connect_offline\n"); 
    21022103 
    2103         /* let_idle_die (store, TRUE); */ 
     2104        let_idle_die (store, TRUE); 
     2105        camel_imap_store_stop_idle (store); 
    21042106 
    21052107        if (!disco_store->diary) 
     
    21182120        imap_debug ("imap_disconnect_offline\n"); 
    21192121 
    2120         /*let_idle_die (store, TRUE);*/ 
     2122        let_idle_die (store, TRUE); 
     2123        camel_imap_store_stop_idle (store); 
    21212124 
    21222125        if (store->istream) { 
  • trunk/libtinymail-camel/tny-camel-account.c

    r3704 r3705  
    21632163                } 
    21642164                camel_object_unref (CAMEL_OBJECT (priv->service)); 
     2165                priv->service = NULL; 
    21652166        } 
    21662167 
  • trunk/libtinymail-camel/tny-camel-store-account.c

    r3666 r3705  
    14121412        priv->iter = iter; 
    14131413        priv->cant_reuse_iter = FALSE; 
     1414 
     1415        if (priv->iter_store) { 
     1416                camel_object_unref (CAMEL_OBJECT (store)); 
     1417        } 
    14141418 
    14151419        camel_object_ref (CAMEL_OBJECT (store)); 
  • trunk/libtinymail-camel/tny-session-camel.c

    r3306 r3705  
    983983         * have embraced references either. So be careful! */ 
    984984 
    985         priv->device = device
     985        priv->device = g_object_ref (device)
    986986 
    987987        return; 
     
    10901090                g_signal_handler_disconnect (G_OBJECT (priv->device),  
    10911091                        priv->connchanged_signal); 
     1092        } 
     1093 
     1094        if (priv->device) { 
     1095                g_object_unref (priv->device); 
    10921096        } 
    10931097 
  • trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c

    r3666 r3705  
    339339         * start asking the account about its folders. */ 
    340340 
    341         if (status == TNY_CONNECTION_STATUS_RECONNECTING
     341        if (status == TNY_CONNECTION_STATUS_RECONNECTING || status == TNY_CONNECTION_STATUS_DISCONNECTED
    342342                return; 
    343343