Commit 8d03a6b4 authored by Philippe Rouquier's avatar Philippe Rouquier Committed by Philippe Rouquier

Fixed memleaks

2009-01-25  Philippe Rouquier  <ykw@localhost.localdomain>

	Fixed memleaks

	* libbrasero-media/brasero-drive-selection.c
	(brasero_drive_selection_show_type),
	(brasero_drive_selection_drive_added_cb),
	(brasero_drive_selection_drive_removed_cb):
	* libbrasero-media/brasero-gio-operation.c
	(brasero_gio_operation_umount):
	* libbrasero-media/brasero-medium-selection.c
	(brasero_medium_selection_show_media_type),
	(brasero_medium_selection_medium_added_cb):
	* src/main.c (brasero_handle_burn_uri):
	* src/plugins/transcode/burn-normalize.c
	(brasero_normalize_export_caps):
	* src/plugins/transcode/burn-vob.c (brasero_vob_export_caps):

svn path=/trunk/; revision=1830
parent 7dc5c0a4
2009-01-25 Philippe Rouquier <ykw@localhost.localdomain>
Fixed memleaks
* libbrasero-media/brasero-drive-selection.c
(brasero_drive_selection_show_type),
(brasero_drive_selection_drive_added_cb),
(brasero_drive_selection_drive_removed_cb):
* libbrasero-media/brasero-gio-operation.c
(brasero_gio_operation_umount):
* libbrasero-media/brasero-medium-selection.c
(brasero_medium_selection_show_media_type),
(brasero_medium_selection_medium_added_cb):
* src/main.c (brasero_handle_burn_uri):
* src/plugins/transcode/burn-normalize.c
(brasero_normalize_export_caps):
* src/plugins/transcode/burn-vob.c (brasero_vob_export_caps):
2009-01-25 Philippe Rouquier <ykw@localhost.localdomain>
Fix #568802 – Brasero 0.9.2 (svn trunk) crashes
......
......@@ -338,6 +338,7 @@ brasero_drive_selection_show_type (BraseroDriveSelection *selector,
ICON_COL, drive_icon,
-1);
g_free (drive_name);
g_object_unref (drive_icon);
}
g_slist_foreach (list, (GFunc) g_object_unref, NULL);
g_slist_free (list);
......@@ -432,6 +433,7 @@ brasero_drive_selection_drive_added_cb (BraseroMediumMonitor *monitor,
ICON_COL, drive_icon,
-1);
g_free (drive_name);
g_object_unref (drive_icon);
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
if (gtk_combo_box_get_active (GTK_COMBO_BOX (self)) == -1) {
......@@ -444,7 +446,7 @@ static void
brasero_drive_selection_drive_removed_cb (BraseroMediumMonitor *monitor,
BraseroDrive *drive,
BraseroDriveSelection *self)
{
{
GtkTreeModel *model;
GtkTreeIter iter;
......
......@@ -205,7 +205,7 @@ brasero_gio_operation_umount (GVolume *gvolume,
GMount *mount;
gboolean result;
BRASERO_MEDIA_LOG ("Unmounting volume %s", g_volume_get_name (gvolume));
BRASERO_MEDIA_LOG ("Unmounting volume");
if (!gvolume) {
BRASERO_MEDIA_LOG ("No volume");
......
......@@ -487,6 +487,7 @@ brasero_medium_selection_show_media_type (BraseroMediumSelection *selector,
ICON_COL, medium_icon,
-1);
g_free (medium_name);
g_object_unref (medium_icon);
}
g_slist_foreach (list, (GFunc) g_object_unref, NULL);
g_slist_free (list);
......@@ -623,6 +624,7 @@ brasero_medium_selection_medium_added_cb (BraseroMediumMonitor *monitor,
ICON_COL, medium_icon,
-1);
g_free (medium_name);
g_object_unref (medium_icon);
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
if (gtk_combo_box_get_active (GTK_COMBO_BOX (self)) == -1) {
......
......@@ -1750,13 +1750,13 @@ brasero_burn_dialog_success_run (BraseroBurnDialog *dialog)
answer = gtk_dialog_run (GTK_DIALOG (dialog));
if (answer == GTK_RESPONSE_CLOSE) {
GtkWidget *contents;
BraseroJacketEdit *contents;
GValue *cover_value;
const gchar *title;
GtkWidget *window;
GSList *tracks;
contents = brasero_jacket_edit_dialog_new (GTK_WIDGET (dialog), &window);
window = brasero_jacket_edit_dialog_new (GTK_WIDGET (dialog), &contents);
title = brasero_burn_session_get_label (dialog->priv->session);
tracks = brasero_burn_session_get_tracks (dialog->priv->session);
......@@ -1766,13 +1766,13 @@ brasero_burn_dialog_success_run (BraseroBurnDialog *dialog)
BRASERO_COVER_URI,
&cover_value);
brasero_jacket_edit_set_audio_tracks (BRASERO_JACKET_EDIT (contents),
brasero_jacket_edit_set_audio_tracks (contents,
title,
cover_value? g_value_get_string (cover_value):NULL,
tracks);
gtk_dialog_run (GTK_DIALOG (window));
gtk_widget_destroy (window);
return FALSE;
}
......
......@@ -99,7 +99,10 @@ brasero_jacket_edit_print_pressed_cb (GtkButton *button,
BraseroJacketEdit *self)
{
BraseroJacketEditPrivate *priv;
GtkPrintOperation *print;
GtkPrintOperationResult res;
GtkPrintOperation *print;
GError *error = NULL;
GtkWidget *toplevel;
priv = BRASERO_JACKET_EDIT_PRIVATE (self);
print = gtk_print_operation_new ();
......@@ -111,10 +114,13 @@ brasero_jacket_edit_print_pressed_cb (GtkButton *button,
"begin-print",
G_CALLBACK (brasero_jacket_edit_print_begin),
self);
gtk_print_operation_run (print,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))),
NULL);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (self));
res = gtk_print_operation_run (print,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (toplevel),
&error);
g_object_unref (print);
}
static void
......@@ -886,7 +892,7 @@ brasero_jacket_edit_new (void)
GtkWidget *
brasero_jacket_edit_dialog_new (GtkWidget *toplevel,
GtkWidget **dialog)
BraseroJacketEdit **contents_ret)
{
GtkWidget *window;
GtkWidget *contents;
......@@ -899,22 +905,15 @@ brasero_jacket_edit_dialog_new (GtkWidget *toplevel,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
gtk_window_set_default_size (GTK_WINDOW (window), 680, 640);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER_ON_PARENT);
g_signal_connect (window,
"response",
G_CALLBACK (gtk_widget_destroy),
NULL);
contents = brasero_jacket_edit_new ();
gtk_widget_show (contents);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), contents, TRUE, TRUE, 0);
gtk_widget_show (window);
if (dialog)
*dialog = window;
if (contents_ret)
*contents_ret = BRASERO_JACKET_EDIT (contents);
return contents;
return window;
}
......@@ -56,7 +56,7 @@ brasero_jacket_edit_new (void);
GtkWidget *
brasero_jacket_edit_dialog_new (GtkWidget *toplevel,
GtkWidget **dialog);
BraseroJacketEdit **contents);
void
brasero_jacket_edit_set_audio_tracks (BraseroJacketEdit *self,
......
......@@ -213,15 +213,20 @@ static void
brasero_project_manager_new_cover_cb (GtkAction *action,
BraseroProjectManager *manager)
{
BraseroJacketEdit *edit;
GtkWidget *toplevel;
GtkWidget *edit;
GtkWidget *dialog;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (manager));
edit = brasero_jacket_edit_dialog_new (toplevel, NULL);
dialog = NULL;
dialog = brasero_jacket_edit_dialog_new (toplevel, &edit);
if (manager->priv->type == BRASERO_PROJECT_TYPE_AUDIO)
brasero_project_set_cover_specifics (BRASERO_PROJECT (manager->priv->project),
BRASERO_JACKET_EDIT (edit));
brasero_project_set_cover_specifics (BRASERO_PROJECT (manager->priv->project), edit);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
static void
......
......@@ -220,8 +220,10 @@ brasero_handle_burn_uri (BraseroApp *app,
return;
}
while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)))
while ((info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL) {
list = g_slist_prepend (list, g_strconcat ("burn:///", g_file_info_get_name (info), NULL));
g_object_unref (info);
}
g_object_unref (enumerator);
g_object_unref (file);
......
......@@ -573,7 +573,6 @@ brasero_normalize_export_caps (BraseroPlugin *plugin, gchar **error)
"\"Rgvolume\"");
return BRASERO_BURN_ERR;
}
gst_object_unref (element);
element = gst_element_factory_make ("rganalysis", NULL);
......@@ -582,7 +581,6 @@ brasero_normalize_export_caps (BraseroPlugin *plugin, gchar **error)
"\"Rganalysis\"");
return BRASERO_BURN_ERR;
}
gst_object_unref (element);
input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
......
......@@ -1182,19 +1182,21 @@ brasero_vob_export_caps (BraseroPlugin *plugin, gchar **error)
element = gst_element_factory_make ("ffenc_mpeg2video", NULL);
if (!element)
return BRASERO_BURN_ERR;
gst_object_unref (element);
element = gst_element_factory_make ("ffenc_ac3", NULL);
if (!element)
return BRASERO_BURN_ERR;
gst_object_unref (element);
element = gst_element_factory_make ("ffenc_mp2", NULL);
if (!element)
return BRASERO_BURN_ERR;
gst_object_unref (element);
element = gst_element_factory_make ("mplex", NULL);
if (!element)
return BRASERO_BURN_ERR;
gst_object_unref (element);
brasero_plugin_define (plugin,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment