Changeset 3440

Show
Ignore:
Timestamp:
03/01/08 13:59:40
Author:
pvanhoof
Message:

Bugfix

Files:

Legend:

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

    r3439 r3440  
    349349} 
    350350 
     351 
     352 
     353static void 
     354camel_pop3_store_destroy_lists_nl (CamelPOP3Store *pop3_store) 
     355{ 
     356 
     357        if (pop3_store->uids != NULL) 
     358        { 
     359                CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **) pop3_store->uids->pdata; 
     360                int i; 
     361 
     362                for (i=0;i<pop3_store->uids->len;i++,fi++) { 
     363                        if (fi[0]->cmd) { 
     364 
     365                                if (pop3_store->engine == NULL) { 
     366                                        g_ptr_array_free(pop3_store->uids, TRUE); 
     367                                        g_hash_table_destroy(pop3_store->uids_uid); 
     368                                        g_free(fi[0]->uid); 
     369                                        g_free(fi[0]); 
     370                                        return; 
     371                                } 
     372 
     373                                while (camel_pop3_engine_iterate(pop3_store->engine, fi[0]->cmd) > 0) 
     374                                        ; 
     375                                camel_pop3_engine_command_free(pop3_store->engine, fi[0]->cmd); 
     376                                fi[0]->cmd = NULL; 
     377                        } 
     378 
     379                        g_free(fi[0]->uid); 
     380                        g_free(fi[0]); 
     381                } 
     382 
     383                kill_lists (pop3_store); 
     384 
     385                pop3_store->uids = g_ptr_array_new (); 
     386                pop3_store->uids_uid = g_hash_table_new(g_str_hash, g_str_equal); 
     387                pop3_store->uids_id = g_hash_table_new(NULL, NULL); 
     388 
     389        } 
     390} 
     391 
    351392static gpointer 
    352393wait_for_login_delay (gpointer user_data) 
     
    367408                sleep (login_delay); 
    368409 
     410                g_static_rec_mutex_lock (store->uidl_lock); 
    369411                g_static_rec_mutex_lock (store->eng_lock); 
     412 
    370413                if (!store->is_refreshing) { 
    371414                        CamelException dex = CAMEL_EXCEPTION_INITIALISER; 
    372                         camel_pop3_store_destroy_lists (store); 
     415                        camel_pop3_store_destroy_lists_nl (store); 
    373416                        camel_service_disconnect (CAMEL_SERVICE (store), TRUE, &dex); 
    374417                        killed = TRUE; 
    375418                } 
    376419                g_static_rec_mutex_unlock (store->eng_lock); 
     420                g_static_rec_mutex_unlock (store->uidl_lock); 
     421 
    377422        } 
    378423