Commit 6b5e983f authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

fixed destroy handler, so it doesn't segfault with the new refcounting

Mon Feb  2 04:15:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
          segfault with the new refcounting scheme anymore.

        * gtk/gtkhandlebox.c:
        * gtk/gtkclist.c:
        * gtk/gtkentry.c:
        * gtk/gtkrange.c:
        * gtk/gtktext.c:
        * gtk/gtkviewport.c:
          enforced
          gdk_window_set_user_data (window, NULL);
          gdk_window_destroy (window);
          window = NULL;
          throughout the code.
parent eeaefdf0
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtktoolbar.c: fixed destroy handler, so it doesn't
segfault with the new refcounting scheme anymore.
* gtk/gtkhandlebox.c:
* gtk/gtkclist.c:
* gtk/gtkentry.c:
* gtk/gtkrange.c:
* gtk/gtktext.c:
* gtk/gtkviewport.c:
enforced
gdk_window_set_user_data (window, NULL);
gdk_window_destroy (window);
window = NULL;
throughout the code.
* gtk/gtkmain.c (gtk_propagate_event): fixed a bad, bad referencing
bug that could caused unreferencing of finalized objects.
......
......@@ -1572,18 +1572,21 @@ gtk_clist_unrealize (GtkWidget * widget)
for (i = 0; i < clist->columns; i++)
if (clist->column[i].window)
{
gdk_window_set_user_data (clist->column[i].window, NULL);
gdk_window_destroy (clist->column[i].window);
clist->column[i].window = NULL;
}
gdk_window_set_user_data (clist->clist_window, NULL);
gdk_window_destroy (clist->clist_window);
clist->clist_window = NULL;
gdk_window_set_user_data (clist->title_window, NULL);
gdk_window_destroy (clist->title_window);
clist->title_window = NULL;
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
clist->clist_window = NULL;
clist->title_window = NULL;
clist->cursor_drag = NULL;
clist->xor_gc = NULL;
clist->fg_gc = NULL;
......
......@@ -690,16 +690,16 @@ gtk_entry_unrealize (GtkWidget *widget)
{
gdk_window_set_user_data (entry->text_area, NULL);
gdk_window_destroy (entry->text_area);
entry->text_area = NULL;
gdk_cursor_destroy (entry->cursor);
entry->cursor = NULL;
}
if (widget->window)
{
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
}
entry->text_area = NULL;
widget->window = NULL;
}
static void
......
......@@ -147,6 +147,7 @@ gtk_handle_box_destroy (GtkObject *object)
hb = GTK_HANDLE_BOX (object);
gdk_cursor_destroy (hb->fleur_cursor);
hb->fleur_cursor = NULL;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
......@@ -264,15 +265,18 @@ gtk_handle_box_unrealize (GtkWidget *widget)
hb = GTK_HANDLE_BOX (widget);
if (widget->window)
gdk_window_destroy (widget->window);
{
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
}
if (hb->steady_window)
gdk_window_destroy (hb->steady_window);
hb->steady_window = NULL;
widget->window = NULL;
/* FIXME: do we have to unref the float_window before destroying it? */
{
gdk_window_set_user_data (hb->steady_window, NULL);
gdk_window_destroy (hb->steady_window);
hb->steady_window = NULL;
}
gtk_widget_destroy (hb->float_window);
hb->float_window = NULL;
......
......@@ -652,33 +652,32 @@ gtk_range_unrealize (GtkWidget *widget)
{
gdk_window_set_user_data (range->slider, NULL);
gdk_window_destroy (range->slider);
range->slider = NULL;
}
if (range->trough)
{
gdk_window_set_user_data (range->trough, NULL);
gdk_window_destroy (range->trough);
range->trough = NULL;
}
if (range->step_forw)
{
gdk_window_set_user_data (range->step_forw, NULL);
gdk_window_destroy (range->step_forw);
range->step_forw = NULL;
}
if (range->step_back)
{
gdk_window_set_user_data (range->step_back, NULL);
gdk_window_destroy (range->step_back);
range->step_back = NULL;
}
if (widget->window)
{
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
}
range->slider = NULL;
range->trough = NULL;
range->step_forw = NULL;
range->step_back = NULL;
widget->window = NULL;
}
static gint
......
......@@ -706,12 +706,11 @@ gtk_text_unrealize (GtkWidget *widget)
gtk_style_detach (widget->style);
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
gdk_window_set_user_data (text->text_area, NULL);
gdk_window_destroy (text->text_area);
gdk_gc_destroy (text->gc);
widget->window = NULL;
text->text_area = NULL;
gdk_gc_destroy (text->gc);
text->gc = NULL;
}
......
......@@ -182,7 +182,6 @@ gtk_toolbar_destroy (GtkObject *object)
{
GtkToolbar *toolbar;
GList *children;
GtkToolbarChild *child;
g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (object));
......@@ -190,23 +189,28 @@ gtk_toolbar_destroy (GtkObject *object)
toolbar = GTK_TOOLBAR (object);
gtk_object_unref (GTK_OBJECT (toolbar->tooltips));
toolbar->tooltips = NULL;
for (children = toolbar->children; children; children = children->next)
{
GtkToolbarChild *child;
child = children->data;
if (child->type != GTK_TOOLBAR_CHILD_SPACE)
{
child->widget->parent = NULL;
gtk_object_unref (GTK_OBJECT (child->widget));
gtk_widget_ref (child->widget);
gtk_widget_unparent (child->widget);
gtk_widget_destroy (child->widget);
gtk_widget_unref (child->widget);
}
g_free (child);
}
g_list_free (toolbar->children);
toolbar->children = NULL;
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
......@@ -515,6 +519,9 @@ gtk_toolbar_remove (GtkContainer *container,
if ((child->type != GTK_TOOLBAR_CHILD_SPACE) && (child->widget == widget))
{
gboolean was_visible;
was_visible = GTK_WIDGET_VISIBLE (widget);
gtk_widget_unparent (widget);
toolbar->children = g_list_remove_link (toolbar->children, children);
......@@ -522,7 +529,7 @@ gtk_toolbar_remove (GtkContainer *container,
g_list_free (children);
toolbar->num_children--;
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container))
if (was_visible && GTK_WIDGET_VISIBLE (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
break;
......@@ -643,7 +650,6 @@ gtk_toolbar_insert_item (GtkToolbar *toolbar,
if (child->label)
gtk_widget_show (child->label);
break;
default:
......
......@@ -351,13 +351,12 @@ gtk_viewport_unrealize (GtkWidget *widget)
gdk_window_set_user_data (widget->window, NULL);
gdk_window_destroy (widget->window);
widget->window = NULL;
gdk_window_set_user_data (viewport->view_window, NULL);
gdk_window_destroy (viewport->view_window);
viewport->view_window = NULL;
gdk_window_set_user_data (viewport->bin_window, NULL);
gdk_window_destroy (viewport->bin_window);
widget->window = NULL;
viewport->view_window = NULL;
viewport->bin_window = NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment