Author: pollux
Date: 2007-01-14 12:49:33 +0000 (Sun, 14 Jan 2007)
New Revision: 24438
Modified:
xfburn/branches/libburn_trial/xfburn/xfburn-blank-cd-dialog.c
xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
xfburn/branches/libburn_trial/xfburn/xfburn-burn-image-dialog.c
xfburn/branches/libburn_trial/xfburn/xfburn-device-list.c
xfburn/branches/libburn_trial/xfburn/xfburn-main.c
Log:
fix segfault when using the burning device a second time (it must exist a
cleaner way to do that)
Modified: xfburn/branches/libburn_trial/xfburn/xfburn-blank-cd-dialog.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-blank-cd-dialog.c
2007-01-14 12:43:49 UTC (rev 24437)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-blank-cd-dialog.c
2007-01-14 12:49:33 UTC (rev 24438)
@@ -163,6 +163,12 @@
enum burn_disc_status disc_state;
struct burn_progress progress;
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ g_free (params);
+ return;
+ }
+
if (!xfburn_device_grab (params->device, &drive_info)) {
xfburn_progress_dialog_burning_failed (XFBURN_PROGRESS_DIALOG
(dialog_progress), _("Unable to grab drive"));
@@ -218,12 +224,8 @@
cleanup:
burn_drive_release (drive, params->eject ? 1 : 0);
- /* commented because it unleashes hell
- DBG ("drive_info: %p", drive_info);
-
- burn_drive_info_free (drive_info);
- */
end:
+ burn_finish ();
g_free (params);
}
Modified:
xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
2007-01-14 12:43:49 UTC (rev 24437)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-burn-data-composition-dialog.c
2007-01-14 12:49:33 UTC (rev 24438)
@@ -380,6 +380,13 @@
gboolean burning_has_started = FALSE;
gint ret;
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ burn_source_free (params->src);
+ g_free (params);
+ return;
+ }
+
disc = burn_disc_create ();
session = burn_session_create ();
track = burn_track_create ();
@@ -479,15 +486,11 @@
cleanup:
burn_drive_release (drive, params->eject ? 1 : 0);
- /* commented because it unleashes hell
- DBG ("drive_info: %p", drive_info);
-
- burn_drive_info_free (drive_info);
- */
end:
burn_track_free (track);
burn_session_free (session);
burn_disc_free (disc);
+ burn_finish ();
burn_source_free (params->src);
g_free (params);
Modified: xfburn/branches/libburn_trial/xfburn/xfburn-burn-image-dialog.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-burn-image-dialog.c
2007-01-14 12:43:49 UTC (rev 24437)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-burn-image-dialog.c
2007-01-14 12:49:33 UTC (rev 24438)
@@ -216,6 +216,13 @@
gboolean burning_has_started = FALSE;
gint ret;
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ g_free (params->iso_path);
+ g_free (params);
+ return;
+ }
+
disc = burn_disc_create ();
session = burn_session_create ();
track = burn_track_create ();
@@ -334,15 +341,11 @@
cleanup:
burn_drive_release (drive, params->eject ? 1 : 0);
- /* commented because it unleashes hell
- DBG ("drive_info: %p", drive_info);
-
- burn_drive_info_free (drive_info);
- */
end:
burn_track_free (track);
burn_session_free (session);
burn_disc_free (disc);
+ burn_finish ();
g_free (params->iso_path);
g_free (params);
Modified: xfburn/branches/libburn_trial/xfburn/xfburn-device-list.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-device-list.c 2007-01-14
12:43:49 UTC (rev 24437)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-device-list.c 2007-01-14
12:49:33 UTC (rev 24438)
@@ -124,7 +124,6 @@
}
}
-
/**************/
/* public API */
/**************/
@@ -139,6 +138,11 @@
{
struct burn_drive_info *drive_info = NULL;
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ return;
+ }
+
if (!xfburn_device_grab (device, &drive_info)) {
g_error ("Couldn't grab drive in order to update speed list.");
return;
@@ -147,6 +151,8 @@
refresh_supported_speeds (device, drive_info);
burn_drive_release (drive_info->drive, 0);
+
+ burn_finish ();
}
void
@@ -156,6 +162,11 @@
gint i;
guint n_drives = 0;
+ if (!burn_initialize ()) {
+ g_critical ("Unable to initialize libburn");
+ return;
+ }
+
if (devices) {
g_list_foreach (devices, (GFunc) device_content_free, NULL);
g_list_free (devices);
@@ -192,15 +203,13 @@
g_error ("Unable to get drive %s address (ret=%d). Please report this
problem to [EMAIL PROTECTED]", device->name, ret);
refresh_supported_speeds (device, &(drives[i]));
-
-
+
devices = g_list_append (devices, device);
- ret = burn_drive_info_forget (&(drives[i]), 1);
- if (ret != 1)
- g_error ("Unable to drop drive %s (ret=%d). Please report problem to
[EMAIL PROTECTED]", device->name, ret);
burn_drive_info_free (&(drives[i]));
}
+
+ burn_finish ();
}
gboolean
Modified: xfburn/branches/libburn_trial/xfburn/xfburn-main.c
===================================================================
--- xfburn/branches/libburn_trial/xfburn/xfburn-main.c 2007-01-14 12:43:49 UTC
(rev 24437)
+++ xfburn/branches/libburn_trial/xfburn/xfburn-main.c 2007-01-14 12:49:33 UTC
(rev 24438)
@@ -32,8 +32,6 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/libxfcegui4.h>
-#include <libburn.h>
-
#ifdef HAVE_THUNAR_VFS
#include <thunar-vfs/thunar-vfs.h>
#endif
@@ -69,11 +67,6 @@
gdk_threads_init ();
gdk_threads_enter ();
- if (!burn_initialize ()) {
- g_critical ("Unable to initiliaze libburn");
- return EXIT_FAILURE;
- }
-
gtk_init (&argc, &argv);
xfburn_settings_init ();
@@ -104,8 +97,6 @@
xfburn_device_list_free ();
- burn_finish ();
-
gdk_threads_leave ();
return EXIT_SUCCESS;
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits