Fix a nautilus segfault when burning

This commit is contained in:
Matthias Clasen 2009-08-03 22:49:31 +00:00
parent 2565d11fc6
commit 0cee1ae5ec
2 changed files with 163 additions and 2 deletions

View File

@ -1,7 +1,6 @@
Name: brasero Name: brasero
Version: 2.27.5 Version: 2.27.5
Release: 1%{?dist} Release: 2%{?dist}
Summary: Gnome CD/DVD burning application Summary: Gnome CD/DVD burning application
Group: Applications/Multimedia Group: Applications/Multimedia
License: GPLv2+ License: GPLv2+
@ -9,6 +8,8 @@ URL: http://www.gnome.org/projects/brasero/
Source0: http://ftp.gnome.org/pub/GNOME/sources/brasero/2.27/%{name}-%{version}.tar.bz2 Source0: http://ftp.gnome.org/pub/GNOME/sources/brasero/2.27/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: nautilus-segfault.patch
BuildRequires: glib2-devel >= 2.15.6 BuildRequires: glib2-devel >= 2.15.6
BuildRequires: gettext intltool gtk-doc BuildRequires: gettext intltool gtk-doc
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -86,6 +87,7 @@ developing brasero applications.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .nautilus-segfault
%build %build
@ -203,6 +205,9 @@ fi
%changelog %changelog
* Mon Aug 3 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.5-2
- Fix a nautilus segfault when burning
* Tue Jul 28 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.5-1 * Tue Jul 28 2009 Matthias Clasen <mclasen@redhat.com> - 2.27.5-1
- Update to 2.27.5 - Update to 2.27.5

156
nautilus-segfault.patch Normal file
View File

@ -0,0 +1,156 @@
diff --git a/libbrasero-burn/brasero-track-data-cfg.c b/libbrasero-burn/brasero-track-data-cfg.c
index 69d3505..3e91a26 100644
--- a/libbrasero-burn/brasero-track-data-cfg.c
+++ b/libbrasero-burn/brasero-track-data-cfg.c
@@ -1754,29 +1754,6 @@ brasero_track_data_clean_autorun (BraseroTrackDataCfg *track)
}
static void
-brasero_track_data_cfg_finalize (GObject *object)
-{
- BraseroTrackDataCfgPrivate *priv;
-
- priv = BRASERO_TRACK_DATA_CFG_PRIVATE (object);
-
- brasero_track_data_clean_autorun (BRASERO_TRACK_DATA_CFG (object));
- brasero_track_data_cfg_clean_cache (BRASERO_TRACK_DATA_CFG (object));
-
- if (priv->shown) {
- g_slist_free (priv->shown);
- priv->shown = NULL;
- }
-
- if (priv->tree) {
- g_object_unref (priv->tree);
- priv->tree = NULL;
- }
-
- G_OBJECT_CLASS (brasero_track_data_cfg_parent_class)->finalize (object);
-}
-
-static void
brasero_track_data_cfg_iface_init (gpointer g_iface, gpointer data)
{
GtkTreeModelIface *iface = g_iface;
@@ -3158,6 +3135,88 @@ brasero_track_data_cfg_init (BraseroTrackDataCfg *object)
}
static void
+brasero_track_data_cfg_finalize (GObject *object)
+{
+ BraseroTrackDataCfgPrivate *priv;
+
+ priv = BRASERO_TRACK_DATA_CFG_PRIVATE (object);
+
+ brasero_track_data_clean_autorun (BRASERO_TRACK_DATA_CFG (object));
+ brasero_track_data_cfg_clean_cache (BRASERO_TRACK_DATA_CFG (object));
+
+ if (priv->shown) {
+ g_slist_free (priv->shown);
+ priv->shown = NULL;
+ }
+
+ if (priv->tree) {
+ /* This object could outlive us just for some time
+ * so we better remove all signals.
+ * When an image URI is detected it can happen
+ * that we'll be destroyed. */
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_node_added,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_node_changed,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_node_removed,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_node_reordered,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_size_changed_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_session_available_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_session_loaded_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_project_loaded,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_activity_changed,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_deep_directory,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_2G_file,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_unreadable_uri_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_unknown_uri_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_recursive_uri_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_image_uri_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_virtual_sibling_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_name_collision_cb,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->tree,
+ brasero_track_data_cfg_joliet_rename_cb,
+ object);
+
+ g_object_unref (priv->tree);
+ priv->tree = NULL;
+ }
+
+ G_OBJECT_CLASS (brasero_track_data_cfg_parent_class)->finalize (object);
+}
+
+static void
brasero_track_data_cfg_class_init (BraseroTrackDataCfgClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
diff --git a/libbrasero-utils/brasero-io.c b/libbrasero-utils/brasero-io.c
index cfeb4d5..bd12861 100644
--- a/libbrasero-utils/brasero-io.c
+++ b/libbrasero-utils/brasero-io.c
@@ -364,6 +364,11 @@ brasero_io_return_result_idle (gpointer callback_data)
g_mutex_unlock (priv->lock);
data = result->callback_data;
+
+ /* This is to make sure the object lives
+ * as long as we need it. */
+ g_object_ref (base->object);
+
if (result->uri || result->info || result->error)
result->base->callback (base->object,
result->error,
@@ -371,12 +376,14 @@ brasero_io_return_result_idle (gpointer callback_data)
result->info,
data? data->callback_data:NULL);
- /* Else this is just to call destroy () for callback data */
+ /* call destroy () for callback data */
brasero_io_unref_result_callback_data (data,
base->object,
base->destroy,
FALSE);
+ g_object_unref (base->object);
+
brasero_io_job_result_free (result);
g_mutex_lock (priv->lock);