// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
const destroyTasks = new Set();
export function registerDestroyTask(task) {
    destroyTasks.add(task);
    return () => {
        destroyTasks.delete(task);
    };
}
export function runDestroyTasks() {
    const tasks = Array.from(destroyTasks);
    for (const task of tasks) {
        task();
    }
    destroyTasks.clear();
}
//# sourceMappingURL=runtime-destroy.js.map