Merge pull request #3890 from Tyriar/dispose_webgl

Dispose of webgl resources properly
This commit is contained in:
Daniel Imms
2022-07-06 07:51:49 -07:00
committed by GitHub
6 changed files with 29 additions and 7 deletions
+7
View File
@@ -50,6 +50,13 @@ export abstract class Disposable implements IDisposable {
}
}
/**
* Wrap a function in a disposable.
*/
export function toDisposable(f: () => void): IDisposable {
return { dispose: f };
}
/**
* Dispose of all disposables in an array and set its length to 0.
*/