MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ stop_session()

MAYAFLUX_HOST_API void MayaFlux::Host::stop_session ( bool clear_persistent_store = false)

Stop the running session.

Function pointers obtained through the session become invalid. Libraries loaded through Host are forgotten, so a later session loads them again.

Parameters
clear_persistent_storeIf true, also empties the persistent store.

Definition at line 298 of file Session.cpp.

299{
300 std::shared_ptr<Lila::Lila> instance;
301 std::optional<Lila::Address> stopped;
302
303 g_state.update([&](State& state) {
304 if (!state.instance) {
305 instance.reset();
306 return false;
307 }
308 instance = std::move(state.instance);
309 stopped = std::exchange(state.address, std::nullopt);
310 state.libraries.clear();
311 return true;
312 });
313
314 if (!instance) {
315 return;
316 }
317
318 LILA_INFO(Lila::Emitter::SYSTEM,
319 "stop_session: stopping on " + where_text(stopped));
320
321 instance->stop_listening();
322 instance.reset();
323
324 if (clear_persistent_store) {
326 LILA_DEBUG(Lila::Emitter::SYSTEM, "stop_session: cleared persistent store");
327 }
328}
#define LILA_DEBUG(emitter, msg)
#define LILA_INFO(emitter, msg)
void cleanup_persistent_store()
Definition Persist.hpp:14

References MayaFlux::internal::cleanup_persistent_store(), LILA_DEBUG, and LILA_INFO.

Here is the call graph for this function: