dtkcore/tools
yeshanshan c5be272ad8 fix: fix dconfig static variable release issue
Fixed dconfig exit crash caused by static variable destruction order
1. Added null pointer check before accessing m_config in updateValue
method to prevent accessing destroyed objects
2. Added m_config.storeRelaxed(nullptr) in destructor to clear the
atomic pointer
3. Added early return checks in connect and updateValue methods when
config is null
4. Updated default value for p_rules to use proper unicode string
literal

The issue occurred because static dconfig objects were being destroyed
after the QCoreApplication instance, leading to attempts to access
already destroyed DConfig objects during cleanup. The fix ensures proper
null checking and pointer cleanup to prevent crashes during application
exit.

Log: Fixed application exit crash related to dconfig static variables

Influence:
1. Test application normal startup and shutdown
2. Verify dconfig functionality still works correctly
3. Test with multiple dconfig instances
4. Verify no crashes occur during application termination
5. Test configuration value changes and updates

fix: 修复dconfig静态变量释放导致的退出异常

修复了由静态变量销毁顺序引起的dconfig退出崩溃问题
1. 在updateValue方法中添加空指针检查,防止访问已销毁的对象
2. 在析构函数中添加m_config.storeRelaxed(nullptr)来清理原子指针
3. 在connect和updateValue方法中添加config为null时的提前返回检查
4. 更新p_rules的默认值为正确的unicode字符串字面量

问题出现在静态dconfig对象在QCoreApplication实例之后被销毁时,导致在清
理过程中尝试访问已销毁的DConfig对象。修复确保进行适当的空值检查和指针清
理,以防止应用程序退出时的崩溃。

Log: 修复了与dconfig静态变量相关的应用程序退出崩溃问题

Influence:
1. 测试应用程序正常启动和关闭
2. 验证dconfig功能仍然正常工作
3. 测试多个dconfig实例的情况
4. 验证应用程序终止时不会发生崩溃
5. 测试配置值更改和更新功能

PMS: BUG-324689
2025-09-25 15:26:44 +08:00
..
ch2py chore: dpinyin tweak 2023-10-09 14:54:15 +08:00
dci chore: fix relative path invalid link 2023-12-13 10:00:26 +08:00
dconfig2cpp fix: fix dconfig static variable release issue 2025-09-25 15:26:44 +08:00
deepin-os-release chore(tools): show help if argc < 2 2023-09-25 10:48:35 +08:00
qdbusxml2cpp fix: resolve non-reproducible DBUS code generation issue 2025-08-19 18:42:54 +08:00
settings chore: remove unused pro files 2023-07-05 10:19:56 +08:00
CMakeLists.txt feat: support auto generate the Qt code from a dconfig's json 2025-02-20 19:45:06 +08:00