9b67b0238d
Resolve URI expansion on the main thread before dispatching async library enumeration tasks. The getUri() call accesses PROJECT text variables and SETTINGS_MANAGER::Prj() which are not thread-safe. When a project is unloaded while worker threads are still running, they would access freed or modified data in PROJECT::TextVarResolver, causing either an access violation in (KICAD-14DS) or an assertion failure when the project list is empty (KICAD-11Q9). Pre-computing the expanded URI on the main thread and passing it to enumerateLibrary() as a parameter eliminates the data race. Resolves KICAD-14DS Resolves KICAD-11Q9