Plug a dynamic leak
A leak occured in the timer code, and thus the memory was growing over time. Cf. src/task-manager.c(model_update_tree_iter), the old_state variable was not free'd. Plugged other static leaks at the same time.
This commit is contained in:
@@ -51,6 +51,7 @@ struct _XtmProcessStatusbar
|
||||
};
|
||||
G_DEFINE_TYPE (XtmProcessStatusbar, xtm_process_statusbar, GTK_TYPE_STATUSBAR)
|
||||
|
||||
static void xtm_process_statusbar_finalize (GObject *object);
|
||||
static void xtm_process_statusbar_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
|
||||
|
||||
|
||||
@@ -60,6 +61,7 @@ xtm_process_statusbar_class_init (XtmProcessStatusbarClass *klass)
|
||||
{
|
||||
GObjectClass *class = G_OBJECT_CLASS (klass);
|
||||
xtm_process_statusbar_parent_class = g_type_class_peek_parent (klass);
|
||||
class->finalize = xtm_process_statusbar_finalize;
|
||||
class->set_property = xtm_process_statusbar_set_property;
|
||||
g_object_class_install_property (class, PROP_CPU,
|
||||
g_param_spec_float ("cpu", "CPU", "CPU usage", 0, 100, 0, G_PARAM_CONSTRUCT|G_PARAM_WRITABLE));
|
||||
@@ -116,6 +118,13 @@ xtm_process_statusbar_init (XtmProcessStatusbar *statusbar)
|
||||
gtk_widget_show_all (hbox);
|
||||
}
|
||||
|
||||
static void
|
||||
xtm_process_statusbar_finalize (GObject *object)
|
||||
{
|
||||
g_object_unref (XTM_PROCESS_STATUSBAR (object)->settings);
|
||||
G_OBJECT_CLASS (xtm_process_statusbar_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
rounded_float_value (gfloat value, XtmSettings *settings)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user