mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 修改 ConfigurationManager 中的 AddOrUpdate 逻辑,先获取旧值再更新以正确检测变更 - 只有在配置值真正发生变化时才触发监听器回调 - 更新异常日志记录方式,移除冗余的标签前缀 - 将 ConfigWatcherUnRegister 移动到正确的命名空间 - 修复 ResourceManager 中的引用计数逻辑,移除重复的 AddReference 调用 - 优化资源加载和卸载时的异常处理和日志记录 - 更新测试注释以反映正确的引用计数行为
21 lines
515 B
C#
21 lines
515 B
C#
using GFramework.Core.Abstractions.events;
|
|
|
|
namespace GFramework.Core.configuration;
|
|
|
|
/// <summary>
|
|
/// 配置监听取消注册接口
|
|
/// </summary>
|
|
internal sealed class ConfigWatcherUnRegister : IUnRegister
|
|
{
|
|
private readonly Action _unRegisterAction;
|
|
|
|
public ConfigWatcherUnRegister(Action unRegisterAction)
|
|
{
|
|
_unRegisterAction = unRegisterAction ?? throw new ArgumentNullException(nameof(unRegisterAction));
|
|
}
|
|
|
|
public void UnRegister()
|
|
{
|
|
_unRegisterAction();
|
|
}
|
|
} |