Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.267
diff -u -r1.1487.2.267 ChangeLog
--- ChangeLog	17 Aug 2005 17:48:01 -0000	1.1487.2.267
+++ ChangeLog	20 Aug 2005 12:39:34 -0000
@@ -1,3 +1,8 @@
+2005-08-20  Anthony W. Juckel  <ajuckel@gmail.com>
+
+	* src/gnome-utils/gnc-tree-model-account.c (gnc_tree_model_account_event_handler): 
+	Make GNC_EVENT_ADD flush any pending_removals for the added entity.
+
 2005-08-17  Neil Williams <linux@codehelp.co.uk>
 
 	*  src/import-export/hbci/hbci-interaction.c:
Index: src/gnome-utils/gnc-tree-model-account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/gnc-tree-model-account.c,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 gnc-tree-model-account.c
--- src/gnome-utils/gnc-tree-model-account.c	22 Jul 2005 18:53:01 -0000	1.1.2.19
+++ src/gnome-utils/gnc-tree-model-account.c	20 Aug 2005 12:39:40 -0000
@@ -1456,6 +1456,15 @@
 
 	switch (event_type) {
 	 case GNC_EVENT_ADD:
+	  /* It is possible that this entity was previously REMOVEd,
+	     yet will not be DESTROYed as would be the case if this
+	     add is the result of a change in account parentage.  In
+	     that case, we should finalize the deletion of the old
+	     path. */
+	  g_slist_foreach (pending_removals,
+			   (GFunc)gnc_tree_model_account_delete_event_helper,
+			   entity);
+	     
 	  /* Tell the filters/views where the new account was added. */
 	  DEBUG("add account %p (%s)", account, account_name);
 	  if (gnc_tree_model_account_get_iter_from_account (model, account, &iter)) {
