From 5bf7f8879cfa921bc717c835c0530418e3497a83 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 23 Oct 2017 01:05:09 -0700 Subject: [PATCH] Make finalize protected, to clean up declarations. --- lib/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(); } -- 2.50.0