mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 04:01:56 +00:00
fix(tui): prevent image ID collisions between modules
- allocateImageId() now returns random IDs instead of sequential - Static images no longer auto-allocate IDs (transient display) - Only explicit imageId usage (like DOSBox) gets tracked IDs - Suppress emulators exit logging in DOSBox dispose Fixes image replacement bug when extension and main app both allocated sequential IDs starting at 1.
This commit is contained in:
parent
df1d5c40ea
commit
fbd6b7f9ba
3 changed files with 26 additions and 22 deletions
|
|
@ -206,8 +206,23 @@ export class DosboxComponent implements Component {
|
|||
this.kittyPushed = false;
|
||||
}
|
||||
if (this.ci) {
|
||||
void this.ci.exit().catch(() => undefined);
|
||||
// Suppress emulators exit logging
|
||||
const origLog = console.log;
|
||||
const origError = console.error;
|
||||
console.log = () => {};
|
||||
console.error = () => {};
|
||||
const ci = this.ci;
|
||||
this.ci = null;
|
||||
void ci
|
||||
.exit()
|
||||
.catch(() => undefined)
|
||||
.finally(() => {
|
||||
// Restore after a delay to catch async logging
|
||||
setTimeout(() => {
|
||||
console.log = origLog;
|
||||
console.error = origError;
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue