Memory problem



Hi Folks
(B
(BI have a function which is eating up lots of memory.  The function is
(Blisted below and is called every 1 second with the same
(B
(BGtkWidget *widget
(B
(Bbeing passed to it each time.
(BWhat do I need to do to stop it eating up memory.  All I want the
(Bfunction to do is set the colours of itself and its parent(if it has
(Bone).
(BAny help greatly appreciated.
(B
(BCheers
(BTony
(B
(B
(B
(B
(Bint SetWidgetColour(GtkWidget *widget, int bordersize, int red,
(B                     int green, int blue)
(B{
(B    GtkStyle *new_style;
(B    GdkColor color;
(B
(B    color.red = red;
(B    color.green = green;
(B    color.blue = blue;
(B
(B    gdk_color_alloc(gdk_colormap_get_system(), &color);
(B    new_style = gtk_style_copy(gtk_widget_get_default_style());
(B    new_style->bg[GTK_STATE_NORMAL] = color;
(B    new_style->bg[GTK_STATE_PRELIGHT] = color;
(B    new_style->bg[GTK_STATE_ACTIVE] = color;
(B    gtk_style_detach (widget->style);
(B    gtk_widget_set_style(GTK_WIDGET(widget), new_style);
(B  
(B    return TRUE;
(B}


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