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

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Tue Sep 1 12:11:15 UTC 2020


Hi Sergey,

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

http://cr.openjdk.java.net/~psadhukhan/8248532/webrev.01/

Regards

Prasanta

On 01-Sep-20 7:10 AM, Sergey Bylokhov wrote:
> Hi, Prasanta.
>
> On 31.08.2020 05:26, Prasanta Sadhukhan wrote:
>> it is seen that "NSNotificationCenter" This notification center 
>> handles notifications within a single process
>>
>> whereas "NSDistributedNotificationCenter" This distributed 
>> notification center handles notifications that can be sent between 
>> processes on a single machine.
>>
>> Since, the app is bundled with Java, notifications needed to handled 
>> between different processes in such case.
>
> It is unclear how the usage of bundled application is related to the 
> crash in the NSNotificationCenter?
>
> Did you check what this message means? 
> "__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__"
>
> We use the NSNotificationCenter in a few places like 
> "LWCToolkit.m#(void)start:(BOOL)headless" and we
> never crash there.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/awt-dev/attachments/20200901/8ec6757c/attachment.htm>


More information about the awt-dev mailing list