06a9e368b9b085df0c78c5391decbd1ced9da8b6 tdreszer Thu Jul 28 16:23:17 2011 -0700 Cleaned up the tdbExtras a little. Jim recommended always allocating. Currently leaving in an assert, but will remove it on next check-in diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c index 0278068..50b6ca2 100644 --- src/hg/lib/trackDbCustom.c +++ src/hg/lib/trackDbCustom.c @@ -1154,15 +1154,34 @@ else { tag = "parent"; } updated = TRUE; } #endif /* SOON */ if (updated) { *pTag = cloneString(tag); *pVal = cloneString(val); } return updated; } +struct tdbExtras *tdbExtrasNew() +// Return a new empty tdbExtras +{ +struct tdbExtras *extras; +AllocVar(extras); // Note no need for extras = AllocVar(extras) +// Initialize any values that need an "empty" state +extras->fourState = TDB_EXTRAS_EMPTY_STATE; // I guess it is 5 state! +// pointers are NULL and booleans are FALSE by default +return extras; +} + +void tdbExtrasFree(struct tdbExtras **pTdbExtras) +// Frees the tdbExtras structure +{ +// Developer, add intelligent routines to free structures +// NOTE: For now just leak contents, because complex structs would also leak +freez(pTdbExtras); +} +