Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

한자 입력기 나갈 때 한자 후보 숨기기 #696

Merged
merged 2 commits into from Feb 11, 2020

Conversation

@youknowone
Copy link
Member

youknowone commented Dec 3, 2019

No description provided.

@youknowone youknowone requested a review from yous Dec 3, 2019
@yous

This comment has been minimized.

Copy link
Member

yous commented Dec 5, 2019

TextEdit.app에서 한자 단축키 입력 및 '안녕' 등의 입력을 빠르게 한 직후 (후보 창이 거의 뜨기도 전이거나 뜬 직후) Cmd-Tab으로 애플리케이션을 전환하면 HangulComposer.swift의 candidateSelectionChanged가 호출되면서 크래시가 발생하는 것 같습니다.

@yous

This comment has been minimized.

Copy link
Member

yous commented Dec 5, 2019

이건 HangulComposer.swift의 candidateSelected(_:)candidateSelectionChanged(_:)의 assert를 뺐을 때 발생하는 크래시입니다.

오류	00:31:50.388098+0900	Gureum	(
	0   CoreFoundation                      0x00007fff31dbb9b3 __exceptionPreprocess + 250
	1   libobjc.A.dylib                     0x00007fff67f40562 objc_exception_throw + 48
	2   Foundation                          0x00007fff344317f3 -[NSConcreteAttributedString string] + 0
	3   Foundation                          0x00007fff3444db8a -[NSConcreteAttributedString initWithString:attributes:] + 27
	4   InputMethodKit                      0x000000010491c4c6 -[IMKCandidatesPrivate candidateSelection:commit:] + 220
	5   InputMethodKit                      0x0000000104935fad -[IMKUICandidateWindowController setSelectedCandidate:setByVoiceOver:] + 165
	6   InputMethodKit                      0x000000010492aee2 -[IMKUICandidateVerticalWindowController updateVisualElements] + 474
	7   InputMethodKit                      0x0000000104934663 -[IMKUICandidateWindowController showCandidates] + 88
	8   InputMethodKit                      0x000000010491d1e0 -[IMKCandidates setCandidates:] + 114
	9   GureumCore                          0x00000001047959dc $s10GureumCore17InputMethodServerC20showOrHideCandidates8composeryAA8Composer_p_tF + 188
	10  GureumCore                          0x00000001047c8ca4 $s10GureumCore14SearchComposerC14searchWorkItem7keyword2in8Dispatch0jfG0CSS_AA0C6Source_ptFyycfU_yycfU_ + 740
	11  GureumCore                          0x00000001047c1c6d $sIeg_IeyB_TR + 45
	12  libdispatch.dylib                   0x00007fff69246583 _dispatch_call_block_and_release + 12
	13  libdispatch.dylib                   0x00007fff6924750e _dispatch_client_callout + 8
	14  libdispatch.dylib                   0x00007fff69252bc4 _dispatch_main_queue_callback_4CF + 1105
	15  CoreFoundation                      0x00007fff31d0b355 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	16  CoreFoundation                      0x00007fff31d0aa8d __CFRunLoopRun + 2384
	17  CoreFoundation                      0x00007fff31d09ec8 CFRunLoopRunSpecific + 503
	18  HIToolbox                           0x00007fff3088267d RunCurrentEventLoopInMode + 292
	19  HIToolbox                           0x00007fff308823bd ReceiveNextEventCommon + 600
	20  HIToolbox                           0x00007fff30882147 _BlockUntilNextEventMatchingListInModeWithFilter + 64
	21  AppKit                              0x00007fff2ef07864 _DPSNextEvent + 990
	22  AppKit                              0x00007fff2ef065d4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
	23  AppKit                              0x00007fff2ef00d76 -[NSApplication run] + 658
	24  Gureum                              0x00000001045c120f main + 1855
	25  libdyld.dylib                       0x00007fff692972e5 start + 1
	26  ???                                 0x0000000000000001 0x0 + 1
)

아무래도 DispatchWorkItem에서 락을 건 채 candidates 업데이트와 showOrHideCandidates(composer:)를 같이 하다보니, 앱 전환 직후에 candidates = nil이 안 되는 게 문제인 것 같네요.

@yous

This comment has been minimized.

Copy link
Member

yous commented Dec 5, 2019

패치 자체에는 별 문제 없어 보입니다. swiftformat 한 번만 돌리면 될 것 같아요.

@youknowone youknowone force-pushed the youknowone:hide-hanja-on-exit branch from bac7772 to 736ae2a Feb 11, 2020
@youknowone youknowone merged commit 290f758 into gureum:master Feb 11, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@youknowone youknowone deleted the youknowone:hide-hanja-on-exit branch Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.