Fixed couple of leaks
This commit is contained in:
parent
5dec2891da
commit
7aa0575a5e
@ -133,15 +133,19 @@ MooEditLang *moo_edit_lang_mgr_get_language_for_file (MooEditLangMgr
|
||||
g_return_val_if_fail (MOO_IS_EDIT_LANG_MGR (mgr) && filename != NULL, NULL);
|
||||
|
||||
utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, &err);
|
||||
if (!utf8_filename) {
|
||||
|
||||
if (!utf8_filename)
|
||||
{
|
||||
g_critical ("%s: could not convert filename to UTF8", G_STRLOC);
|
||||
if (err) {
|
||||
if (err)
|
||||
{
|
||||
g_critical ("%s: %s", G_STRLOC, err->message);
|
||||
g_error_free (err);
|
||||
}
|
||||
}
|
||||
|
||||
if (utf8_filename) {
|
||||
if (utf8_filename)
|
||||
{
|
||||
GSList *l;
|
||||
gboolean found = FALSE;
|
||||
|
||||
@ -214,6 +218,7 @@ MooEditLang *moo_edit_lang_mgr_get_language_for_file (MooEditLangMgr
|
||||
g_message ("%s: could not find lang for file '%s'", G_STRLOC, filename);
|
||||
#endif
|
||||
|
||||
g_free (utf8_filename);
|
||||
return lang;
|
||||
}
|
||||
|
||||
|
@ -924,6 +924,8 @@ moo_ui_xml_insert (MooUIXML *xml,
|
||||
merge_add_node (merge, node);
|
||||
update_widgets (xml, UPDATE_ADD_NODE, node);
|
||||
}
|
||||
|
||||
moo_markup_doc_unref (doc);
|
||||
}
|
||||
|
||||
|
||||
@ -1282,11 +1284,18 @@ moo_ui_node_get_child (MooUINode *node,
|
||||
SLIST_FOREACH_END;
|
||||
|
||||
if (child)
|
||||
{
|
||||
node = child;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
{
|
||||
node = NULL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
g_strfreev (pieces);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -2195,5 +2204,8 @@ moo_ui_xml_finalize (GObject *object)
|
||||
g_slist_free (xml->priv->merged_ui);
|
||||
node_free (xml->priv->ui);
|
||||
|
||||
g_free (xml->priv);
|
||||
xml->priv = NULL;
|
||||
|
||||
G_OBJECT_CLASS(moo_ui_xml_parent_class)->finalize (object);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user