| 2411 | } |
| 2412 | |
| 2413 | static void unload_image (struct cdunit *cdu) |
| 2414 | { |
| 2415 | int i; |
| 2416 | |
| 2417 | for (i = 0; i < sizeof cdu->toc / sizeof (struct cdtoc); i++) { |
| 2418 | struct cdtoc *t = &cdu->toc[i]; |
| 2419 | zfile_fclose (t->handle); |
| 2420 | if (t->handle != t->subhandle) |
| 2421 | zfile_fclose (t->subhandle); |
| 2422 | xfree (t->fname); |
| 2423 | xfree (t->data); |
| 2424 | xfree (t->subdata); |
| 2425 | xfree (t->extrainfo); |
| 2426 | } |
| 2427 | #ifdef WITH_CHD |
| 2428 | cdrom_close (cdu->chd_cdf); |
| 2429 | cdu->chd_cdf = NULL; |
| 2430 | if (cdu->chd_f) |
| 2431 | cdu->chd_f->close(); |
| 2432 | cdu->chd_f = NULL; |
| 2433 | #endif |
| 2434 | memset (cdu->toc, 0, sizeof cdu->toc); |
| 2435 | cdu->tracks = 0; |
| 2436 | cdu->cdsize = 0; |
| 2437 | } |
| 2438 | |
| 2439 | |
| 2440 | static int open_device (int unitnum, const TCHAR *ident, int flags) |
no test coverage detected