widget: Drop the destroy vfunc

We still emit the ::destroy signal, but if you
want a vfunc, use dispose.
This commit is contained in:
Matthias Clasen 2020-05-05 16:59:31 -04:00
parent 84944f1c63
commit a4cfbec5c2
2 changed files with 3 additions and 7 deletions

View File

@ -570,8 +570,8 @@ static void gtk_widget_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gtk_widget_dispose (GObject *object);
static void gtk_widget_real_destroy (GtkWidget *object);
static void gtk_widget_finalize (GObject *object);
static void gtk_widget_real_destroy (GtkWidget *object);
static void gtk_widget_real_show (GtkWidget *widget);
static void gtk_widget_real_hide (GtkWidget *widget);
static void gtk_widget_real_map (GtkWidget *widget);
@ -902,8 +902,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
gobject_class->set_property = gtk_widget_set_property;
gobject_class->get_property = gtk_widget_get_property;
klass->destroy = gtk_widget_real_destroy;
klass->activate_signal = 0;
klass->show = gtk_widget_real_show;
klass->hide = gtk_widget_real_hide;
@ -1360,7 +1358,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
g_signal_new (I_("destroy"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS,
G_STRUCT_OFFSET (GtkWidgetClass, destroy),
0,
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
@ -7197,6 +7195,7 @@ gtk_widget_dispose (GObject *object)
priv->in_destruction = TRUE;
g_signal_emit (object, widget_signals[DESTROY], 0);
priv->in_destruction = FALSE;
gtk_widget_real_destroy (widget);
}
sizegroups = _gtk_widget_get_sizegroups (widget);

View File

@ -135,8 +135,6 @@ struct _GtkWidget
* @activate_signal: The signal to emit when a widget of this class is
* activated, gtk_widget_activate() handles the emission.
* Implementation of this signal is optional.
* @destroy: Signals that all holders of a reference to the widget
* should release the reference that they hold.
* @show: Signal emitted when widget is shown
* @hide: Signal emitted when widget is hidden.
* @map: Signal emitted when widget is going to be mapped, that is
@ -214,7 +212,6 @@ struct _GtkWidgetClass
guint activate_signal;
/* basics */
void (* destroy) (GtkWidget *widget);
void (* show) (GtkWidget *widget);
void (* hide) (GtkWidget *widget);
void (* map) (GtkWidget *widget);