<AWT Dev> RFR: 8248532: Every time I change keyboard language at my MacBook, Java crashes

Phil Race prr at openjdk.java.net
Sun Sep 6 22:49:32 UTC 2020


On Sun, 6 Sep 2020 20:13:39 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> It seems the observer either needs to be removed when it is dealloced/destroyed (Otherwise Notification Centre would
>> send the notification to the destroyed object resulting in crash.)
>> and we need to do the below in dealloc, which solves the crash in my system.
>> 
>> NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:self]
>> 
>> But it is not done for LWCToolkit, so I changed the observer as is being done there, to make existing @implementation
>> class as observer
>
> Marked as reviewed by serb (Reviewer).

You say you need to use NSDistributedNotificationCenter but you don't. So I am confused.

-------------

PR: https://git.openjdk.java.net/jdk/pull/28


More information about the awt-dev mailing list