MCPcopy Create free account
hub / github.com/VCVRack/Rack / ~Engine

Method ~Engine

src/engine/Engine.cpp:496–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494
495
496Engine::~Engine() {
497 // Stop fallback thread if running
498 {
499 std::lock_guard<std::mutex> lock(internal->fallbackMutex);
500 internal->fallbackRunning = false;
501 internal->fallbackCv.notify_all();
502 }
503 if (internal->fallbackThread.joinable())
504 internal->fallbackThread.join();
505
506 // Shut down workers
507 Engine_relaunchWorkers(this, 0);
508
509 // Clear modules, cables, etc
510 clear();
511
512 // Make sure there are no cables or modules in the rack on destruction.
513 // If this happens, a module must have failed to remove itself before the RackWidget was destroyed.
514 assert(internal->cables.empty());
515 assert(internal->modules.empty());
516 assert(internal->paramHandles.empty());
517
518 assert(internal->modulesCache.empty());
519 assert(internal->cablesCache.empty());
520 assert(internal->paramHandlesCache.empty());
521
522 delete internal;
523}
524
525
526void Engine::clear() {

Callers

nothing calls this directly

Calls 3

Engine_relaunchWorkersFunction · 0.85
joinMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected