Wed Jan 21 23:27:14 2004  Matthias Clasen  <maclas@gmx.de>

	Fix #131869:

	* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
	a reference to the group while emitting the signals.

	* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
	destroy notify which does not only unref, but also resets
	the action_group property of the action.
This commit is contained in:
Matthias Clasen
2004-01-21 22:26:53 +00:00
committed by Matthias Clasen
parent 577157a196
commit a18431078a
7 changed files with 74 additions and 6 deletions

View File

@ -1,3 +1,14 @@
Wed Jan 21 23:27:14 2004 Matthias Clasen <maclas@gmx.de>
Fix #131869:
* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
a reference to the group while emitting the signals.
* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
destroy notify which does not only unref, but also resets
the action_group property of the action.
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* NEWS: Added details about GtkFileChooser changes.

View File

@ -1,3 +1,14 @@
Wed Jan 21 23:27:14 2004 Matthias Clasen <maclas@gmx.de>
Fix #131869:
* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
a reference to the group while emitting the signals.
* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
destroy notify which does not only unref, but also resets
the action_group property of the action.
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* NEWS: Added details about GtkFileChooser changes.

View File

@ -1,3 +1,14 @@
Wed Jan 21 23:27:14 2004 Matthias Clasen <maclas@gmx.de>
Fix #131869:
* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
a reference to the group while emitting the signals.
* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
destroy notify which does not only unref, but also resets
the action_group property of the action.
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* NEWS: Added details about GtkFileChooser changes.

View File

@ -1,3 +1,14 @@
Wed Jan 21 23:27:14 2004 Matthias Clasen <maclas@gmx.de>
Fix #131869:
* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
a reference to the group while emitting the signals.
* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
destroy notify which does not only unref, but also resets
the action_group property of the action.
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* NEWS: Added details about GtkFileChooser changes.

View File

@ -1,3 +1,14 @@
Wed Jan 21 23:27:14 2004 Matthias Clasen <maclas@gmx.de>
Fix #131869:
* gtk/gtkaction.c (_gtk_action_emit_activate): Hold
a reference to the group while emitting the signals.
* gtk/gtkactiongroup.c (gtk_action_group_init): Use a
destroy notify which does not only unref, but also resets
the action_group property of the action.
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* NEWS: Added details about GtkFileChooser changes.

View File

@ -957,13 +957,19 @@ _gtk_action_emit_activate (GtkAction *action)
{
GtkActionGroup *group = action->private_data->action_group;
if (group != NULL)
_gtk_action_group_emit_pre_activate (group, action);
if (group != NULL)
{
g_object_ref (group);
_gtk_action_group_emit_pre_activate (group, action);
}
g_signal_emit (action, action_signals[ACTIVATE], 0);
if (group != NULL)
_gtk_action_group_emit_post_activate (group, action);
if (group != NULL)
{
_gtk_action_group_emit_post_activate (group, action);
g_object_unref (group);
}
}
/**

View File

@ -246,6 +246,14 @@ gtk_action_group_class_init (GtkActionGroupClass *klass)
g_type_class_add_private (gobject_class, sizeof (GtkActionGroupPrivate));
}
static void
remove_action (GtkAction *action)
{
g_object_set (action, "action_group", NULL, NULL);
g_object_unref (action);
}
static void
gtk_action_group_init (GtkActionGroup *self)
{
@ -255,7 +263,7 @@ gtk_action_group_init (GtkActionGroup *self)
self->private_data->visible = TRUE;
self->private_data->actions = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
(GDestroyNotify) remove_action);
self->private_data->translate_func = NULL;
self->private_data->translate_data = NULL;
self->private_data->translate_notify = NULL;
@ -609,7 +617,6 @@ gtk_action_group_remove_action (GtkActionGroup *action_group,
/* extra protection to make sure action->name is valid */
g_object_ref (action);
g_hash_table_remove (action_group->private_data->actions, gtk_action_get_name (action));
g_object_set (G_OBJECT (action), "action_group", NULL, NULL);
g_object_unref (action);
}