Review Request 122232: KConfig: fix using KSharedConfig in global object destructor.
Matthew Dawson
matthew at mjdsystems.ca
Tue Jan 27 20:55:03 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122232/#review74858
-----------------------------------------------------------
Unforunately, this cause test system failures in the the kconfigskeletontest test suite. I'm not sure why this should create issues there.
However, I have a partial solution that avoids creating a full KSharedConfig. Instead, only globalData needs to be called in KConfig to ensure the object is created as soon as possible (without needing a QCoreApplication). This should avoid having any other globals created before.
However, this causes a crash later. The root of the issue is in the KConfigPrivate constructor, line 98. Creating the QLocale after QCoreApplication is gone is apparently broken as well. I'm not sure how to solve that, maybe cache the value we need from QLocale, similar to caching the arguments?
Also, I think the copied over KConfig test case really needs to match the KSharedConfig test, as using KSharedConfig can mask the problem since KSharedConfig's pointer is cached, avoiding the KConfig constructor.
- Matthew Dawson
On Jan. 27, 2015, 3:10 a.m., David Faure wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122232/
> -----------------------------------------------------------
>
> (Updated Jan. 27, 2015, 3:10 a.m.)
>
>
> Review request for KDE Frameworks and Matthew Dawson.
>
>
> Repository: kconfig
>
>
> Description
> -------
>
> kconfig_in_global_object.cpp comes from kdelibs4support
> (after porting to Q_GLOBAL_STATIC)
>
> ksharedconfig_in_global_object.cpp is new (but works with kdelibs4)
> and reproduces Albert's KgDifficulty testcase.
>
>
> Diffs
> -----
>
> autotests/kconfig_in_global_object.cpp PRE-CREATION
> autotests/ksharedconfig_in_global_object.cpp PRE-CREATION
> src/core/kconfig.cpp 782e9714521234a3e3d8f3a788967e5c9a40f38a
> src/core/ksharedconfig.cpp e059b87a1cc1df50693a668ef791e7a61050ef88
> autotests/CMakeLists.txt b91f754b705fc87bb8b729bea72fbb5f7d427ace
>
> Diff: https://git.reviewboard.kde.org/r/122232/diff/
>
>
> Testing
> -------
>
> Both tests pass and the QCoreApplication::arguments warning (because called after qApp is destroyed) is gone.
>
>
> Thanks,
>
> David Faure
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150127/95081729/attachment.html>
More information about the Kde-frameworks-devel
mailing list