Changeset 3258

Show
Ignore:
Timestamp:
01/14/08 23:21:50
Author:
pvanhoof
Message:

Memleak fixes and a bugfix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3249 r3258  
    77        CamelOperation holds one more significant memory leak at its 
    88        status_hack linked list. That one is not yet fixed. 
     9        * Flag setting to 0xffff must be 0x1fff as bit 13 and 14 are system 
     10        bits that should not be altered like that. 
    911 
    10122008-01-13  Philip Van Hoof <pvanhoof@gnome.org> 
  • trunk/libtinymail-camel/camel-lite/camel/camel-folder-summary.h

    r3216 r3258  
    9090 
    9191/* Changes to system flags will NOT trigger a folder changed event */ 
    92 #define CAMEL_MESSAGE_SYSTEM_MASK (0xffff << 12) 
     92#define CAMEL_MESSAGE_SYSTEM_MASK (0x1fff << 12) 
    9393 
    9494typedef struct _CamelFlag { 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r3249 r3258  
    442442        CamelImapStore *imap_store = CAMEL_IMAP_STORE (object); 
    443443 
     444        imap_store->authtypes = NULL; 
    444445        imap_store->got_online = FALSE; 
    445446        imap_store->going_online = FALSE; 
     
    785786        /* We assume we have utf8 capable search until a failed search tells us otherwise */ 
    786787        store->capabilities = IMAP_CAPABILITY_utf8_search; 
     788 
     789        if (store->authtypes) { 
     790                g_hash_table_foreach_remove (store->authtypes, 
     791                                             free_key, NULL); 
     792                g_hash_table_destroy (store->authtypes); 
     793                store->authtypes = NULL; 
     794        } 
     795 
    787796        store->authtypes = g_hash_table_new (g_str_hash, g_str_equal); 
    788797        response = camel_imap_command (store, NULL, ex, "CAPABILITY"); 
  • trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-local-summary.c

    r3217 r3258  
    458458#endif 
    459459                        mi->info.flags = camel_message_info_flags(info); 
    460                         /*mi->info.flags |= (camel_message_info_flags(info) & 0xffff);*/ 
     460                        /*mi->info.flags |= (camel_message_info_flags(info) & 0x1fff);*/ 
    461461                        mi->info.size = ((CamelMessageInfoBase*)info)->size; 
    462462                } 
     
    506506                p++; 
    507507        if (*p == 0 && sscanf (uidstr, "%u", &uid) == 1) { 
    508                 g_string_printf (out, "%08x-%04x", uid, mi->info.flags & 0xffff); 
     508                g_string_printf (out, "%08x-%04x", uid, mi->info.flags & 0x1fff); 
    509509        } else { 
    510                 g_string_printf (out, "%s-%04x", uidstr, mi->info.flags & 0xffff); 
     510                g_string_printf (out, "%s-%04x", uidstr, mi->info.flags & 0x1fff); 
    511511        } 
    512512 
  • trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-maildir-summary.c

    r3242 r3258  
    317317#endif 
    318318                        mi->info.flags = camel_message_info_flags(info); 
    319                         /*mi->info.flags |= (camel_message_info_flags(info) & 0xffff);*/ 
     319                        /*mi->info.flags |= (camel_message_info_flags(info) & 0x1fff);*/ 
    320320                        mi->info.size = ((CamelMessageInfoBase*)info)->size; 
    321321                } 
     
    808808 
    809809                        /* have our flags/ i.e. name changed? */ 
    810                         if (strcmp(newname, camel_maildir_info_filename (mdi))) { 
     810                        if (newname && strcmp(newname, camel_maildir_info_filename (mdi))) { 
    811811                                name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi)); 
    812812                                dest = g_strdup_printf("%s/cur/%s", cls->folder_path, newname); 
     
    815815                                        /* we'll assume it didn't work, but dont change anything else */ 
    816816                                        g_free(newname); 
     817                                        newname = NULL; 
    817818                                } 
    818819                                g_free(name); 
    819820                                g_free(dest); 
    820                         } else { 
     821                        }  
     822 
     823                        if (newname) 
    821824                                g_free(newname); 
    822                         } 
    823825 
    824826                        /* strip FOLDER_MESSAGE_FLAGED, etc */ 
    825                         mdi->info.info.flags &= 0xffff; 
     827                        mdi->info.info.flags &= 0x1fff; 
    826828                } 
    827829                camel_message_info_free(info); 
  • trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-mbox-summary.c

    r3216 r3258  
    234234 
    235235        if (*p == 0 && sscanf(uidstr, "%u", &uid) == 1) { 
    236                 return g_strdup_printf("%08x-%04x", uid, mi->info.flags & 0xffff); 
     236                return g_strdup_printf("%08x-%04x", uid, mi->info.flags & 0x1fff); 
    237237        } else { 
    238                 return g_strdup_printf("%s-%04x", uidstr, mi->info.flags & 0xffff); 
     238                return g_strdup_printf("%s-%04x", uidstr, mi->info.flags & 0x1fff); 
    239239        } 
    240240} 
     
    814814                camel_mime_parser_drop_step(mp); 
    815815 
    816                 info->info.info.flags &= 0xffff; 
     816                info->info.info.flags &= 0x1fff; 
    817817                camel_message_info_free((CamelMessageInfo *)info); 
    818818        } 
     
    10321032                                goto error; 
    10331033                        } 
    1034                         info->info.info.flags &= 0xffff; 
     1034                        info->info.info.flags &= 0x1fff; 
    10351035                        g_free(xevnew); 
    10361036                        xevnew = NULL; 
  • trunk/libtinymail-camel/camel-lite/camel/providers/local/camel-mh-summary.c

    r3216 r3258  
    337337                        g_free(name); 
    338338                } else if (info->info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED)) { 
    339                         info->info.flags &= 0xffff; 
     339                        info->info.flags &= 0x1fff; 
    340340                } 
    341341                camel_message_info_free(info); 
  • trunk/libtinymail-camel/tny-camel-folder.c

    r3235 r3258  
    29072907        { 
    29082908                TnyFolder *cur = TNY_FOLDER (tny_iterator_get_current (iter)); 
    2909                 recurse_evt (cur, TNY_FOLDER_STORE (folder), list, func, rem); 
     2909                list = recurse_evt (cur, TNY_FOLDER_STORE (folder), list, func, rem); 
    29102910                g_object_unref (cur); 
    29112911                tny_iterator_next (iter); 
     
    46034603 
    46044604        if (!info || camel_exception_is_set (&ex) || !priv->account) { 
    4605                 if (camel_exception_is_set (&ex)) 
     4605                if (camel_exception_is_set (&ex)) { 
    46064606                        g_set_error (err, TNY_FOLDER_STORE_ERROR,  
    46074607                                TNY_FOLDER_STORE_ERROR_CREATE_FOLDER, 
    46084608                                camel_exception_get_description (&ex)); 
    4609                 else 
     4609                        camel_exception_clear (&ex); 
     4610                } else 
    46104611                        g_set_error (err, TNY_FOLDER_STORE_ERROR,  
    46114612                                TNY_FOLDER_STORE_ERROR_CREATE_FOLDER, 
  • trunk/libtinymail/tny-folder-store-query.c

    r3161 r3258  
    7676{ 
    7777        TnyFolderStoreQuery *self = (TnyFolderStoreQuery*) object; 
    78         g_object_unref (G_OBJECT (self->items)); 
     78        g_object_unref (self->items); 
    7979        parent_class->finalize (object); 
    8080        return;