* De-init ncurses, signoff from the CIB and deallocate memory. */
| 2255 | * De-init ncurses, signoff from the CIB and deallocate memory. |
| 2256 | */ |
| 2257 | void |
| 2258 | clean_up(int rc) |
| 2259 | { |
| 2260 | #if ENABLE_SNMP |
| 2261 | netsnmp_session *session = crm_snmp_init(NULL, NULL); |
| 2262 | |
| 2263 | if (session) { |
| 2264 | snmp_close(session); |
| 2265 | snmp_shutdown("snmpapp"); |
| 2266 | } |
| 2267 | #endif |
| 2268 | |
| 2269 | #if CURSES_ENABLED |
| 2270 | if (as_console) { |
| 2271 | as_console = FALSE; |
| 2272 | echo(); |
| 2273 | nocbreak(); |
| 2274 | endwin(); |
| 2275 | } |
| 2276 | #endif |
| 2277 | |
| 2278 | if (cib != NULL) { |
| 2279 | cib->cmds->signoff(cib); |
| 2280 | cib_delete(cib); |
| 2281 | cib = NULL; |
| 2282 | } |
| 2283 | |
| 2284 | free(as_html_file); |
| 2285 | free(xml_file); |
| 2286 | free(pid_file); |
| 2287 | |
| 2288 | if (rc >= 0) { |
| 2289 | crm_exit(rc); |
| 2290 | } |
| 2291 | return; |
| 2292 | } |
no test coverage detected