MCPcopy Create free account
hub / github.com/OpenPrinting/cups / _ppdCacheDestroy

Function _ppdCacheDestroy

cups/ppd-cache.c:2082–2165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2080 */
2081
2082void
2083_ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
2084{
2085 int i; /* Looping var */
2086 pwg_map_t *map; /* Current map */
2087 pwg_size_t *size; /* Current size */
2088
2089
2090 /*
2091 * Range check input...
2092 */
2093
2094 if (!pc)
2095 return;
2096
2097 /*
2098 * Free memory as needed...
2099 */
2100
2101 if (pc->bins)
2102 {
2103 for (i = pc->num_bins, map = pc->bins; i > 0; i --, map ++)
2104 {
2105 free(map->pwg);
2106 free(map->ppd);
2107 }
2108
2109 free(pc->bins);
2110 }
2111
2112 if (pc->sizes)
2113 {
2114 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++)
2115 {
2116 free(size->map.pwg);
2117 free(size->map.ppd);
2118 }
2119
2120 free(pc->sizes);
2121 }
2122
2123 free(pc->source_option);
2124
2125 if (pc->sources)
2126 {
2127 for (i = pc->num_sources, map = pc->sources; i > 0; i --, map ++)
2128 {
2129 free(map->pwg);
2130 free(map->ppd);
2131 }
2132
2133 free(pc->sources);
2134 }
2135
2136 if (pc->types)
2137 {
2138 for (i = pc->num_types, map = pc->types; i > 0; i --, map ++)
2139 {

Callers 9

load_ppd_attributesFunction · 0.85
cupsdDeletePrinterFunction · 0.85
load_ppdFunction · 0.85
mainFunction · 0.85
_ppdCacheCreateWithFileFunction · 0.85
_ppdCacheCreateWithPPDFunction · 0.85
mainFunction · 0.85
test_ppd_cacheFunction · 0.85
ppdCloseFunction · 0.85

Calls 1

cupsArrayDeleteFunction · 0.85

Tested by 2

mainFunction · 0.68
test_ppd_cacheFunction · 0.68