This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace audioTest | |
{ | |
//Executes specified method on the UI thread every [ms] milliseconds | |
class SyncTimerDispatcher | |
{ | |
public delegate void TickDelegate(); | |
//Your custom function to be called periodically | |
public TickDelegate TickHandler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const disposeObjectCallback = (dispose) => { | |
dispose(); | |
} | |
const registry = new FinalizationRegistry(disposeObjectCallback); | |
const registerDisposable = (instance) => { | |
if (instance instanceof IDisposable) { | |
// register weak reference to instance and pass dispose function as callback | |
registry.register(new WeakRef(instance), instance._disposeCallback); |