From: Jay Freeman (saurik) Date: Mon, 23 Oct 2017 08:05:09 +0000 (-0700) Subject: Make finalize protected, to clean up declarations. X-Git-Tag: v0.9.1~2 X-Git-Url: https://git.saurik.com/logizomai.git/commitdiff_plain/5bf7f8879cfa921bc717c835c0530418e3497a83?hp=aad9a6ddddc4f121e9446a77f52b5a77c2d20f96 Make finalize protected, to clean up declarations. --- diff --git a/lib/index.ts b/lib/index.ts index e3aa4cd..881b0fe 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -35,7 +35,7 @@ export abstract class Resource { this.finalize(); } - public finalize(): void { + protected finalize(): void { for (let prototype = this; prototype !== null; prototype = Object.getPrototypeOf(prototype)) if (prototype.hasOwnProperty("@resource")) for (const property of (prototype as any)["@resource"] as string[]) @@ -102,7 +102,7 @@ export class ResourceSet extends Resource { this.set = new Set(); } - public finalize(): void { + protected finalize(): void { this.clear(); super.finalize(); } @@ -154,7 +154,7 @@ export class FutureSet extends ResourceSet { this.waiters = null; } - public finalize(): void { + protected finalize(): void { this.cancel(); super.finalize(); } @@ -204,7 +204,7 @@ export class ResourceMap extends Resource { this.map = new Map(); } - public finalize(): void { + protected finalize(): void { this.clear(); super.finalize(); } @@ -276,7 +276,7 @@ export class ResourceArray extends Resource { this.array = new Array(size).fill(null); } - public finalize(): void { + protected finalize(): void { for (const value of this.array) if (value !== null) value.release(); @@ -339,7 +339,7 @@ export class Scoped extends Resource { this.remove = remove; } - public finalize(): void { + protected finalize(): void { this.remove(); super.finalize(); }