| | device - hosts a per-device pipe::server, keyed by puuid, separate from the driver-level control pipe Each connected client is represented by a user_client instance holding a std::shared_ptr<device>, so the device stays alive for as long as any client stays connected to it. conclude() stops that pipe before calling super::conclude(); since pipe::server::stop() unconditionally joins every instance - connected or not - this releases every user_client's device reference synchronously, within the same call. A caller holding the last other std::shared_ptr<device> (e.g. map::driver::remove()) is therefore guaranteed to reach a zero refcount, and run the device's destructor, before conclude() returns - independent of any further pipe activity. This is what lets a deferred cleanup step tied to the device's own destruction (e.g. the Windows registry preference's schedule_erase, dx_registry.h) complete within the same remove() call instead of depending on a future connection. More...
|