addEndingListener

static void addEndingListener(Runnable listener)

Adds a listener that will run when the script ends. This is useful for cleanup tasks.

Parameters

listener

the script end listener