discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for a bug in NSLocale.m


From: Mathias Bauer
Subject: Re: Patch for a bug in NSLocale.m
Date: Mon, 03 Mar 2014 20:27:03 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Basically, yes. The question is why this was set to "nil" in the first place - to me it looked intentionally. But probabyl you are right, assiging an empty dict immediately can't make it worse.


Am 03.03.14 19:22, schrieb Stefan Bidi:
I think the correct thing to do would be assign an empty dictionary to
_components in +defaultsDidChange:, instead.


On Mon, Mar 3, 2014 at 12:03 PM, Mathias Bauer <mathias_bauer@gmx.net
<mailto:mathias_bauer@gmx.net>> wrote:

    Hi,

    I came across a "funny" issue in NSLocale.

    Whenever NSLocale reacts on a "defaultsDidChange" notification, it
    sets the _components attributes of the "autoupdatingLocale" instance
    to nil and also sets the currentLocale to nil.

    Next time when the currentLocale instance is queried, it is
    retrieved from the "allLocales". The instance returned from there
    has a _components attribute that is nil. This leads to disaster.

    _components could be nil just because it always was or because it
    was the "autoupdatingLocale" instance and so it was reset in the
    notification, I didn't dive into that. Instead of that I added the
    attached patch.

    Comments welcome.

    Regards,
    Mathias

    _______________________________________________
    Discuss-gnustep mailing list
    Discuss-gnustep@gnu.org <mailto:Discuss-gnustep@gnu.org>
    https://lists.gnu.org/mailman/listinfo/discuss-gnustep





reply via email to

[Prev in Thread] Current Thread [Next in Thread]