| 2143 | */ |
| 2144 | |
| 2145 | static void |
| 2146 | delete_printer(ippeve_printer_t *printer) /* I - Printer */ |
| 2147 | { |
| 2148 | if (printer->ipv4 >= 0) |
| 2149 | close(printer->ipv4); |
| 2150 | |
| 2151 | if (printer->ipv6 >= 0) |
| 2152 | close(printer->ipv6); |
| 2153 | |
| 2154 | #if HAVE_MDNSRESPONDER |
| 2155 | if (printer->printer_ref) |
| 2156 | DNSServiceRefDeallocate(printer->printer_ref); |
| 2157 | if (printer->ipp_ref) |
| 2158 | DNSServiceRefDeallocate(printer->ipp_ref); |
| 2159 | if (printer->ipps_ref) |
| 2160 | DNSServiceRefDeallocate(printer->ipps_ref); |
| 2161 | if (printer->http_ref) |
| 2162 | DNSServiceRefDeallocate(printer->http_ref); |
| 2163 | #elif defined(HAVE_AVAHI) |
| 2164 | avahi_threaded_poll_lock(DNSSDMaster); |
| 2165 | |
| 2166 | if (printer->dnssd_ref) |
| 2167 | avahi_entry_group_free(printer->dnssd_ref); |
| 2168 | |
| 2169 | avahi_threaded_poll_unlock(DNSSDMaster); |
| 2170 | #endif /* HAVE_MDNSRESPONDER */ |
| 2171 | |
| 2172 | if (printer->dnssd_name) |
| 2173 | free(printer->dnssd_name); |
| 2174 | if (printer->name) |
| 2175 | free(printer->name); |
| 2176 | if (printer->icons[0]) |
| 2177 | free(printer->icons[0]); |
| 2178 | if (printer->strings) |
| 2179 | free(printer->strings); |
| 2180 | if (printer->command) |
| 2181 | free(printer->command); |
| 2182 | if (printer->device_uri) |
| 2183 | free(printer->device_uri); |
| 2184 | #if !CUPS_LITE |
| 2185 | if (printer->ppdfile) |
| 2186 | free(printer->ppdfile); |
| 2187 | #endif /* !CUPS_LITE */ |
| 2188 | if (printer->directory) |
| 2189 | free(printer->directory); |
| 2190 | if (printer->hostname) |
| 2191 | free(printer->hostname); |
| 2192 | |
| 2193 | ippDelete(printer->attrs); |
| 2194 | cupsArrayDelete(printer->jobs); |
| 2195 | |
| 2196 | free(printer); |
| 2197 | } |
| 2198 | |
| 2199 | |
| 2200 | #ifdef HAVE_MDNSRESPONDER |
no test coverage detected