| 493 | } |
| 494 | |
| 495 | ~CardinalUI() override |
| 496 | { |
| 497 | rack::contextSet(context); |
| 498 | |
| 499 | context->nativeWindowId = 0; |
| 500 | |
| 501 | rack::window::WindowSetPluginUI(context->window, nullptr); |
| 502 | |
| 503 | context->tlw = nullptr; |
| 504 | context->ui = nullptr; |
| 505 | |
| 506 | #if CARDINAL_VARIANT_MINI && ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS |
| 507 | { |
| 508 | const ScopedContext sc(this); |
| 509 | context->patch->clear(); |
| 510 | |
| 511 | // do a little dance to prevent context scene deletion from saving to temp dir |
| 512 | const ScopedValueSetter<bool> svs(rack::settings::headless, true); |
| 513 | Engine_setAboutToClose(context->engine); |
| 514 | delete context; |
| 515 | } |
| 516 | |
| 517 | if (! fAutosavePath.empty()) |
| 518 | rack::system::removeRecursively(fAutosavePath); |
| 519 | #endif |
| 520 | |
| 521 | #if ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS |
| 522 | if (fInitializer->shouldSaveSettings) |
| 523 | { |
| 524 | INFO("Save settings"); |
| 525 | rack::settings::save(); |
| 526 | } |
| 527 | #endif |
| 528 | |
| 529 | rack::contextSet(nullptr); |
| 530 | } |
| 531 | |
| 532 | void onNanoDisplay() override |
| 533 | { |
nothing calls this directly
no test coverage detected