generated from ztimson/template
Garbage colleciton fix
This commit is contained in:
@@ -294,8 +294,14 @@ export class ZimReader {
|
||||
/** Opens the archive and parses its header + mimetype list. */
|
||||
async open() {
|
||||
this.#fd = await fs.promises.open(this.path, 'r');
|
||||
await this.#readHeader();
|
||||
await this.#readMimeTypes();
|
||||
try {
|
||||
await this.#readHeader();
|
||||
await this.#readMimeTypes();
|
||||
} catch (e) {
|
||||
await this.#fd.close();
|
||||
this.#fd = null;
|
||||
throw e;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user