gtk_clist_append



I am using the following code to update my list but I noticed that my
memory usage increases with almost every call I make to
gtk_clist_append.

(btw: I commented out the call to the systemstatus_update function and
the memory usage increase disappear so I am pretty sure the problem
exists in this function).

------------------------------------------------------------------------
-
void
systemstatus_update(UI_ERROR_WARNING_BODY_CMD_t *body)
{
   gint i;
   static gint row = 0;
   gchar *message;

   message = body->data; 

   row = gtk_clist_append
            (GTK_CLIST(SYSTEMSTATUSi_entries.clst_messages),
             &message);

   /* Delete old rows when the count of rows gets beyond 20. */
   if (row > 20)
   {
      gtk_clist_freeze(GTK_CLIST(SYSTEMSTATUSi_entries.clst_messages));

      for (i = 20; i >= 0; i--)
      {
         gtk_clist_remove
                (GTK_CLIST(SYSTEMSTATUSi_entries.clst_messages),
                 i);
      }
      
      gtk_clist_thaw(GTK_CLIST(SYSTEMSTATUSi_entries.clst_messages));

      row = 0;
   }
}
------------------------------------------------------------------------
------

Can anyone tell me what I am doing wrong?  I am using gtk 1.2.

Thanks,

Lourdes Maldonado



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]