/** These are the functions used to register a library's memory cleanup *functions.Eachlibraryshoulddefineasinglelibraryregisterfunction *tocallthisAPI.Inthei18nlibrary,itisucln_i18n_registerCleanup(). * *NoneofthecleanupfunctionsshoulduseamutextocleanupanAPI's *allocatedmemorybecauseacleanupfunctionisnotmeanttobethreadsafe, *andplentyofdatacannotbereferencecountedinordertomakesurethat *nooneelseneedstheallocateddata. * *Inordertomakeacleanupfunctiongetcalledwhenu_cleanupiscalled, *Youshouldaddyourfunctiontothelibraryspecificcleanupfunction. *Ifthecleanupfunctionisnotinthecommonlibrary,thecodethat *allocatesthememoryshouldcallthelibraryspecificcleanupfunction. *Forinstance,inthei18nlibrary,anymemoryallocatedstaticallymust *callucln_i18n_registerCleanup()fromtheucln_in.hheader.Theselibrary *cleanupfunctionsareneededinordertopreventacirculardependency *betweenthecommonlibraryandanyotherlibrary. * *Theorderofthecleanupisveryimportant.Ingeneral,anAPIthat *dependsonasecondAPIshouldbecleanedupbeforethesecondAPI. *Forinstance,thedefaultconverterinustringdependsupontheconverter *API.SothedefaultconvertershouldbeclosedbeforetheconverterAPI *hasitscacheflushed.Thiswillpreventanymemoryleaksdueto *referencecounting. * *Pleaseseecommon/ucln_cmn.{h,c}andi18n/ucln_in.{h,c}forexamples.
*/
/** *DataTypeforcleanupfunctionselector.Theseroughlycorrespondtolibraries.
*/ typedefenum ECleanupLibraryType {
UCLN_START = -1,
UCLN_UPLUG, /* ICU plugins */
UCLN_CUSTOM, /* Custom is for anyone else. */
UCLN_CTESTFW,
UCLN_TOOLUTIL,
UCLN_LAYOUTEX,
UCLN_LAYOUT,
UCLN_IO,
UCLN_I18N,
UCLN_COMMON /* This must be the last one to cleanup. */
} ECleanupLibraryType;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.