void (@NotNull RegistryValueListener listener, @NotNull CoroutineScope coroutineScope) { myListeners.add(listener); Objects.requireNonNull(coroutineScope.getCoroutineContext().get(Job.Key)).invokeOnCompletion(__ -> { myListeners.remove(listener); return Unit.INSTANCE; }); }