fix UI block issues

This commit is contained in:
SoftFever
2026-02-02 18:12:19 +08:00
parent d817a4d5d4
commit 431943408b
7 changed files with 124 additions and 65 deletions

View File

@@ -106,6 +106,9 @@ public:
/**
* Create a printer agent by ID (using registry)
*
* Returns a cached instance if one exists for the given ID, otherwise
* creates a new agent via the registered factory and caches it.
*
* @param id Agent ID to create
* @param cloud_agent Cloud agent for token access
* @param log_dir Directory for log files
@@ -115,6 +118,13 @@ public:
std::shared_ptr<ICloudServiceAgent> cloud_agent,
const std::string& log_dir);
/**
* Clear the printer agent cache.
* Calls disconnect_printer() on each cached agent and releases all shared_ptrs.
* Should be called during application shutdown before destroying the NetworkAgent.
*/
static void clear_printer_agent_cache();
// ========================================================================
// Cloud Agent Factory
// ========================================================================