Merge pull request #3890 from Tyriar/dispose_webgl
Dispose of webgl resources properly
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user