Index: src/hg/lib/cart.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/cart.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -b -B -U 4 -r1.116 -r1.117
--- src/hg/lib/cart.c	14 Jan 2010 07:37:39 -0000	1.116
+++ src/hg/lib/cart.c	12 Apr 2010 16:16:19 -0000	1.117
@@ -1844,9 +1844,9 @@
 
 void cartRemoveAllForTdb(struct cart *cart, struct trackDb *tdb)
 /* Remove all variables from cart that are associated with this tdb. */
 {
-char setting[128];
+char setting[256];
 safef(setting,sizeof(setting),"%s.",tdb->tableName);
 cartRemovePrefix(cart,setting);
 safef(setting,sizeof(setting),"%s_",tdb->tableName); // TODO: All should be {tableName}.{varName}... Fix {tableName}_sel
 cartRemovePrefix(cart,setting);
@@ -1856,12 +1856,13 @@
 void cartRemoveAllForTdbAndChildren(struct cart *cart, struct trackDb *tdb)
 /* Remove all variables from cart that are associated
    with this tdb and it's children. */
 {
-cartRemoveAllForTdb(cart,tdb);
 struct trackDb *subTdb;
 for(subTdb=tdb->subtracks;subTdb!=NULL;subTdb=subTdb->next)
     cartRemoveAllForTdbAndChildren(cart,subTdb);
+cartRemoveAllForTdb(cart,tdb);
+        saveState(cart);
 }
 
 char *cartOrTdbString(struct cart *cart, struct trackDb *tdb, char *var, char *defaultVal)
 /* Look first in cart, then in trackDb for var.  Return defaultVal if not found. */

