Index: vte.c
===================================================================
RCS file: /cvs/gnome/vte/src/vte.c,v
retrieving revision 1.385
diff -p -u -r1.385 vte.c
--- vte.c	15 Sep 2003 18:51:29 -0000	1.385
+++ vte.c	27 Nov 2003 11:45:12 -0000
@@ -11431,21 +11431,6 @@ vte_terminal_unrealize(GtkWidget *widget
 					     root_pixmap_changed_cb,
 					     widget);
 
-	/* Shut down accessibility. */
-	if (terminal->pvt->accessible != NULL) {
-		g_object_remove_weak_pointer(G_OBJECT(terminal->pvt->accessible),
-					     &terminal->pvt->accessible);
-#ifdef VTE_DEBUG
-		if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
-			fprintf(stderr, "Accessible peer has refcount %d "
-				"before we unref it.\n",
-				(G_OBJECT(terminal->pvt->accessible))->ref_count);
-		}
-#endif
-		g_object_unref(G_OBJECT(terminal->pvt->accessible));
-		terminal->pvt->accessible = NULL;
-	}
-
 	/* Deallocate the cursors. */
 	terminal->pvt->mouse_cursor_visible = FALSE;
 	gdk_cursor_unref(terminal->pvt->mouse_default_cursor);
@@ -11727,6 +11712,21 @@ vte_terminal_finalize(GObject *object)
 	}
 	_vte_termcap_free(terminal->pvt->termcap);
 	terminal->pvt->termcap = NULL;
+
+	/* Shut down accessibility. */
+	if (terminal->pvt->accessible != NULL) {
+		g_object_remove_weak_pointer(G_OBJECT(terminal->pvt->accessible),
+					     &terminal->pvt->accessible);
+#ifdef VTE_DEBUG
+		if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
+			fprintf(stderr, "Accessible peer has refcount %d "
+				"before we unref it.\n",
+				(G_OBJECT(terminal->pvt->accessible))->ref_count);
+		}
+#endif
+		g_object_unref(G_OBJECT(terminal->pvt->accessible));
+		terminal->pvt->accessible = NULL;
+	}
 
 	/* Done with our private data. */
 	g_free(terminal->pvt);
Index: vteaccess.c
===================================================================
RCS file: /cvs/gnome/vte/src/vteaccess.c,v
retrieving revision 1.43
diff -p -u -r1.43 vteaccess.c
--- vteaccess.c	12 Aug 2003 13:17:33 -0000	1.43
+++ vteaccess.c	27 Nov 2003 11:45:13 -0000
@@ -840,10 +840,6 @@ vte_terminal_accessible_finalize(GObject
 	accessible = GTK_ACCESSIBLE(object);
 	gobject_class = g_type_class_peek_parent(VTE_TERMINAL_ACCESSIBLE_GET_CLASS(object));
 
-	if (accessible->widget != NULL) {
-		g_object_remove_weak_pointer(G_OBJECT(accessible->widget),
-					     (gpointer*) &accessible->widget);
-	}
 	if (G_IS_OBJECT(accessible->widget)) {
 		g_signal_handlers_disconnect_matched(G_OBJECT(accessible->widget),
 						     G_SIGNAL_MATCH_FUNC |
