7d885ab4170329d915b6301c048d0f5eb13d2379 tdreszer Mon Aug 1 13:05:27 2011 -0700 Backtracking on tdbExtras. I don't think it should be defined for every tdb, but only defined when needed. I do think there should be getters and setters, because of create on use and because encapsulating object knowledge/assumptions makes sense long term. diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index ee82187..a33006a 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -3583,32 +3583,30 @@ for (tdb = tdbList; tdb != NULL; tdb = tdb->next) { if (parent != NULL) { if (tdbIsMultiTrack(parent)) tdbMarkAsMultiTrackChild(tdb); if (tdbIsComposite(parent) || (parent->parent != NULL && tdbIsComposite(parent->parent))) { if (tdb->subtracks == NULL) tdbMarkAsCompositeChild(tdb); else tdbMarkAsCompositeView(tdb); } } - if(tdb->tdbExtras == NULL) // probably assertable, but don't make a repeat call harmful - tdb->tdbExtras = tdbExtrasNew(); trackDbContainerMarkup(tdb, tdb->subtracks); } } static struct trackDb *pruneEmpties(struct trackDb *tdbList, char *db, boolean privateHost, int level) /* Remove tracks without data. For parent tracks data in any child is sufficient to keep * them alive. */ { struct trackDb *newList = NULL, *tdb, *next; for (tdb = tdbList; tdb != NULL; tdb = next) { next = tdb->next; if (tdb->subtracks != NULL) @@ -3758,31 +3756,31 @@ return trackTdb; } struct trackDb *tdbForTrack(char *db, char *track,struct trackDb **tdbList) /* Load trackDb object for a track. If track is composite, its subtracks * will also be loaded and inheritance will be handled; if track is a * subtrack then inheritance will be handled. (Unless a subtrack has * "noInherit on"...) This will die if the current database does not have * a trackDb, but will return NULL if track is not found. * MAY pass in prepopulated trackDb list, or may receive the trackDb list as an inout. */ { /* Get track list .*/ struct trackDb *theTdbs = NULL; if (tdbList == NULL || *tdbList == NULL) { -//#define HGAPI_NEEDS_THIS +#define HGAPI_NEEDS_THIS #ifdef HGAPI_NEEDS_THIS // This was removed becuase of missing cart. BUT CART ISN"T USED DOWN BLELOW // NOTE: Currently any call to this (hub or not), makes a tdbList and leaks it! if (isHubTrack(track)) { struct hash *hash = hashNew(0); // NOTE: cart is not even used! theTdbs = hubConnectAddHubForTrackAndFindTdb((struct cart *)NULL,db, track, tdbList, hash); return hashFindVal(hash, track); // leaks tdbList and hash } else #endif///def HGAPI_NEEDS_THIS { theTdbs = hTrackDb(db); if (tdbList != NULL)