AudioEngine::drop_backend ()
{
if (_backend) {
- stop(false);
+ _backend->stop ();
_backend->drop_device ();
_backend.reset ();
_running = false;
return 0;
}
- if (_session && _running) {
- // it's not a halt, but should be handled the same way:
- // disable record, stop transport and I/O processign but save the data.
- _session->engine_halted ();
- }
-
Glib::Threads::Mutex::Lock lm (_process_lock);
if (_backend->stop ()) {
return -1;
}
+ if (_session && _running &&
+ (_session->state_of_the_state() & Session::Loading) == 0 &&
+ (_session->state_of_the_state() & Session::Deletion) == 0) {
+ // it's not a halt, but should be handled the same way:
+ // disable record, stop transport and I/O processign but save the data.
+ _session->engine_halted ();
+ }
+
_running = false;
_processed_frames = 0;
_measuring_latency = MeasureNone;