Fixed bunch of leaks

master
Yevgen Muntyan 2007-08-06 13:17:25 -05:00
parent 89a400bd30
commit 07cb6a5995
18 changed files with 52 additions and 41 deletions

View File

@ -62,3 +62,6 @@ DISTCLEANFILES = \
po-subdirs-stamp
distuninstallcheck_listfiles = find . -type f -print | grep -v share/mime/ | grep -v share/icons/hicolor
snapshot:
$(MAKE) dist && mv $(PACKAGE)-$(VERSION).tar.bz2 $(PACKAGE)-`date +%F-%H-%M`.tar.bz2

View File

@ -1561,6 +1561,8 @@ moo_app_write_session (MooApp *app)
g_free (file);
g_error_free (error);
}
g_free (string);
}
void

View File

@ -112,6 +112,7 @@ _moo_app_input_free (MooAppInput *ch)
g_return_if_fail (ch != NULL);
g_slist_foreach (ch->pipes, (GFunc) input_channel_free, NULL);
g_slist_free (ch->pipes);
g_free (ch->main_path);
g_free (ch->appname);

View File

@ -35,7 +35,7 @@
<match what="stderr" pattern="(?P&lt;file&gt;[^:]+)\((?P&lt;line&gt;\d+)\):(\d+:)?\s*(warning|remark).*" style="output-error"/>
<match what="stderr" pattern="\s+File &quot;(?P&lt;file&gt;[^&quot;]+)&quot;, line (?P&lt;line&gt;\d+), in .*" style="output-error"/>
<match what="stderr" pattern="\s+File &quot;(?P&lt;file&gt;[^&quot;]+)&quot;, line (?P&lt;line&gt;\d+).*" style="output-error"/>
<match what="stdout" pattern="^g?make\[\d+\]: Entering directory `(?P&lt;dir&gt;.*)'">
<action type="push" name="directory" substring="dir"/>

View File

@ -2710,6 +2710,7 @@ regex_resolve (Regex *regex,
new_regex = regex_new ("$never-match^", 0, NULL);
}
g_free (expanded_regex);
g_regex_unref (start_ref);
return new_regex;
}

View File

@ -1050,7 +1050,7 @@ moo_edit_filename_changed (MooEdit *edit,
gboolean lang_changed = FALSE;
MooLang *lang = NULL, *old_lang = NULL;
const char *lang_id = NULL;
const char *filter_config = NULL;
char *filter_config = NULL;
old_lang = moo_text_view_get_lang (MOO_TEXT_VIEW (edit));
@ -1091,6 +1091,8 @@ moo_edit_filename_changed (MooEdit *edit,
}
_moo_edit_thaw_config_notify (edit);
g_free (filter_config);
}

View File

@ -225,7 +225,10 @@ moo_edit_class_install_action (MooEditClass *klass,
GtkAction *action = create_action (action_id, info, l->data);
if (action)
{
moo_edit_add_action (l->data, action);
g_object_unref (action);
}
}
}
}
@ -542,7 +545,10 @@ add_action (const char *id,
GtkAction *action = create_action (id, info, edit);
if (action)
{
moo_edit_add_action (edit, action);
g_object_unref (action);
}
}
void

View File

@ -38,8 +38,8 @@ typedef struct {
static FilterSettingsStore *settings_store;
static const char *filter_settings_store_get_setting (FilterSettingsStore *store,
const char *filename);
static char *filter_settings_store_get_setting (FilterSettingsStore *store,
const char *filename);
static void
@ -169,7 +169,7 @@ _moo_edit_filter_settings_reload (void)
}
static const char *
static char *
_moo_edit_filter_settings_get_for_file_utf8 (const char *filename)
{
g_return_val_if_fail (settings_store != NULL, NULL);
@ -181,11 +181,11 @@ _moo_edit_filter_settings_get_for_file_utf8 (const char *filename)
}
const char *
char *
_moo_edit_filter_settings_get_for_file (const char *filename)
{
char *filename_utf8;
const char *result;
char *result;
g_return_val_if_fail (filename != NULL, NULL);
@ -216,7 +216,7 @@ filter_setting_match (FilterSetting *setting,
}
static const char *
static char *
filter_settings_store_get_setting (FilterSettingsStore *store,
const char *filename)
{

View File

@ -28,7 +28,7 @@ void _moo_edit_filter_settings_load (void);
GSList *_moo_edit_filter_settings_get_strings (void);
void _moo_edit_filter_settings_set_strings (GSList *strings);
const char *_moo_edit_filter_settings_get_for_file (const char *filename);
char *_moo_edit_filter_settings_get_for_file (const char *filename);
G_END_DECLS

View File

@ -2550,6 +2550,8 @@ create_tab_label (MooEditWindow *window,
G_CALLBACK (tab_icon_button_press),
window);
g_object_unref (group);
return hbox;
}

View File

@ -229,6 +229,8 @@ moo_indenter_finalize (GObject *object)
if (indent->priv->re)
_moo_indenter_regex_unref (indent->priv->re);
g_free (indent->priv->id);
G_OBJECT_CLASS(moo_indenter_parent_class)->finalize (object);
}

View File

@ -998,6 +998,7 @@ destroy_layout (MooIconView *view)
g_free (column);
}
g_slist_free (view->priv->layout->columns);
g_free (view->priv->layout);
view->priv->layout = NULL;
}
@ -1259,6 +1260,7 @@ static gboolean moo_icon_view_update_layout (MooIconView *view)
g_free (column);
}
g_slist_free (layout->columns);
layout->columns = NULL;
layout->num_rows = 0;

View File

@ -364,8 +364,7 @@ _wrap_moo_closure_new (G_GNUC_UNUSED PyObject *self, PyObject *args)
Py_INCREF (closure->func);
closure->args = cl_args;
moo_closure_ref ((MooClosure*) closure);
moo_closure_sink ((MooClosure*) closure);
moo_closure_ref_sink ((MooClosure*) closure);
return pyg_boxed_new (MOO_TYPE_CLOSURE, closure, FALSE, TRUE);
}

View File

@ -61,6 +61,7 @@ moo_action_collection_dispose (GObject *object)
g_slist_free (coll->priv->groups_list);
g_free (coll->priv->name);
g_free (coll->priv);
coll->priv = NULL;
}
G_OBJECT_CLASS (moo_action_collection_parent_class)->dispose (object);

View File

@ -91,8 +91,8 @@ moo_closure_invoke (MooClosure *closure)
closure->call (closure);
closure->in_call = FALSE;
if (!closure->valid)
moo_closure_invalidate (closure);
if (!closure->valid && closure->destroy)
closure->destroy (closure);
moo_closure_unref (closure);
}
@ -105,8 +105,12 @@ moo_closure_invalidate (MooClosure *closure)
if (closure && closure->valid)
{
closure->valid = FALSE;
if (!closure->in_call && closure->destroy)
{
closure->destroy (closure);
closure->destroy = (MooClosureDestroy) 0xdeadbeef;
}
}
}

View File

@ -708,6 +708,15 @@ moo_font_selection_show_available_fonts (MooFontSelection *fontsel)
}
}
if (!match_family && fontsel->monospace)
{
g_free (families);
fontsel->monospace = FALSE;
moo_font_selection_show_available_fonts (fontsel);
fontsel->monospace = TRUE;
return;
}
fontsel->family = match_family;
if (match_family)
{

View File

@ -342,6 +342,7 @@ mgr_remove (MooMenuMgr *mgr,
g_slist_free (items_to_free);
g_slist_free (menus_to_free);
g_slist_free (menus);
ensure_active_item (mgr);

View File

@ -122,7 +122,6 @@ static gboolean node_is_ancestor (Node *node,
Node *ancestor);
static gboolean node_is_empty (Node *node);
static GSList *node_list_children (Node *ndoe);
static GSList *node_list_all_children (Node *ndoe);
static void node_free (Node *node);
static void node_foreach (Node *node,
NodeForeachFunc func,
@ -2466,43 +2465,20 @@ toplevel_add_node (MooUIXML *xml,
}
static GSList*
node_list_all_children (Node *node)
{
GSList *list, *l;
g_return_val_if_fail (node != NULL, NULL);
list = g_slist_append (NULL, node);
for (l = node->children; l != NULL; l = l->next)
list = g_slist_append (list, node_list_all_children (l->data));
return list;
}
static void
toplevel_remove_node (G_GNUC_UNUSED MooUIXML *xml,
Toplevel *toplevel,
Node *node)
{
GSList *children, *l;
GtkWidget *widget;
g_return_if_fail (node != toplevel->node);
g_return_if_fail (node_is_ancestor (node, toplevel->node));
children = node_list_all_children (node);
widget = g_hash_table_lookup (toplevel->children, node);
for (l = children; l != NULL; l = l->next)
{
GtkWidget *widget = g_hash_table_lookup (toplevel->children, node);
if (widget)
gtk_widget_destroy (widget);
}
g_slist_free (children);
if (widget)
gtk_widget_destroy (widget);
}