Fixed couple of leaks

master
Yevgen Muntyan 2005-11-07 07:46:02 +00:00
parent 109c3a14af
commit 8f69df508b
3 changed files with 19 additions and 5 deletions

View File

@ -674,6 +674,7 @@ _moo_python_plugin_register (PyObject *py_plugin_type,
plugin_type = g_type_register_static (MOO_TYPE_PLUGIN, plugin_type_name,
&plugin_type_info, 0);
g_free (plugin_type_name);
if (!moo_plugin_register (plugin_type))
{
@ -817,6 +818,7 @@ static GType
generate_win_plugin_type (PyObject *py_type,
MooPyPluginClassData *class_data)
{
GType type;
char *type_name = NULL;
static GTypeInfo type_info;
int i;
@ -845,7 +847,10 @@ generate_win_plugin_type (PyObject *py_type,
type_info.instance_size = sizeof (MooPyWinPlugin);
type_info.instance_init = (GInstanceInitFunc) moo_py_win_plugin_instance_init;
return g_type_register_static (MOO_TYPE_WIN_PLUGIN, type_name, &type_info, 0);
type = g_type_register_static (MOO_TYPE_WIN_PLUGIN, type_name, &type_info, 0);
g_free (type_name);
return type;
}
static GType
@ -855,6 +860,7 @@ generate_doc_plugin_type (PyObject *py_type,
char *type_name = NULL;
static GTypeInfo type_info;
int i;
GType type;
g_return_val_if_fail (py_type != NULL, 0);
g_return_val_if_fail (PyType_Check (py_type), 0);
@ -880,7 +886,10 @@ generate_doc_plugin_type (PyObject *py_type,
type_info.instance_size = sizeof (MooPyDocPlugin);
type_info.instance_init = (GInstanceInitFunc) moo_py_doc_plugin_instance_init;
return g_type_register_static (MOO_TYPE_DOC_PLUGIN, type_name, &type_info, 0);
type = g_type_register_static (MOO_TYPE_DOC_PLUGIN, type_name, &type_info, 0);
g_free (type_name);
return type;
}

View File

@ -1959,10 +1959,14 @@ static MooTermProfile*
get_default_shell (MooTerm *term)
{
if (!term->priv->default_shell)
{
MooTermCommand *cmd = _moo_term_get_default_shell ();
g_return_val_if_fail (cmd != NULL, NULL);
term->priv->default_shell =
moo_term_profile_new ("Default",
_moo_term_get_default_shell (),
NULL, g_get_home_dir ());
moo_term_profile_new ("Default", cmd, NULL,
g_get_home_dir ());
moo_term_command_free (cmd);
}
return term->priv->default_shell;
}

View File

@ -207,6 +207,7 @@ _moo_term_tag_table_free (MooTermTagTable *table)
g_slist_free (table->tags);
g_hash_table_destroy (table->named_tags);
g_free (table);
}
}