brasero/nautilus-segfault.patch

157 lines
6.1 KiB
Diff
Raw Normal View History

2009-08-03 22:49:31 +00:00
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);