Ignore:
Timestamp:
03/16/07 07:39:08 (6 years ago)
Author:
zhiyong_sun
Message:

bug fixed: list_view.c::moko_add_window:pixbuf pointer free error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/list_view.c

    r1382 r1383  
    161161/* Destruction */ 
    162162void  
    163 moko_task_list_clear(MokoTaskList *l) {  
     163moko_task_list_clear(MokoTaskList *l)  
     164{  
    164165    if (!l) g_free (l); 
    165166} 
     
    174175    name = moko_get_window_name(dpy, w); 
    175176    if (!strcmp (name, "Openmoko-taskmanager")) 
    176         { 
     177    { 
    177178        g_free (name); 
    178179        return; 
    179         } 
     180    } 
    180181 
    181182    icon = moko_get_window_icon (dpy, w); 
     
    183184    gtk_list_store_set (list_store, &iter, TEXT_COL, name, OBJECT_COL, w, -1); 
    184185 
    185     if (icon) { 
     186    if (icon)  
     187        { 
    186188        GdkPixbuf *icons = gdk_pixbuf_scale_simple (icon, 160, 160, GDK_INTERP_BILINEAR); 
    187189        gtk_list_store_set (list_store, &iter, PIXBUF_COL, icons, -1); 
    188         gdk_pixbuf_unref (icons); 
    189         } 
     190            gdk_pixbuf_unref (icons); 
     191    } 
    190192    else if (default_icon)  
    191193        gtk_list_store_set (list_store, &iter, PIXBUF_COL, default_icon, -1); 
     
    193195            g_error ("Failed to load %s's icon", name); 
    194196 
    195     gdk_pixbuf_unref (icon); 
     197    if (icon) 
     198            gdk_pixbuf_unref (icon); 
    196199    g_free (name); 
    197    } 
     200} 
    198201 
    199202void  
     
    215218        Window w; 
    216219        gtk_tree_model_get (GTK_TREE_MODEL (list_store), &iter, OBJECT_COL, &w, -1); 
    217         for (i=0; i<nr; i++) { 
    218             if (list[i] == w) { 
     220        for (i=0; i<nr; i++)  
     221                { 
     222            if (list[i] == w)  
     223                        { 
    219224                p[i] = 1; 
    220225                found = TRUE; 
    221226                break; 
    222                 } 
    223227            } 
     228        } 
    224229        if (found) 
    225230            more = gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), &iter); 
     
    230235    } 
    231236     
    232     for (i=0; i<nr; i++) { 
     237    for (i=0; i<nr; i++)  
     238        { 
    233239        if (p[i] == 0 && list[i] != my_win) 
    234240            moko_add_window (dpy, list[i], list_store); 
    235         } 
     241        } 
    236242 
    237243        g_free (p); 
Note: See TracChangeset for help on using the changeset viewer.