Clean up reading buf at deactivation (fixes #72)

This commit is contained in:
Lukhnos Liu 2012-12-13 19:50:04 -08:00
parent 2cc115e894
commit 92e2d41eba
1 changed files with 7 additions and 0 deletions

View File

@ -304,8 +304,15 @@ public:
- (void)deactivateServer:(id)client - (void)deactivateServer:(id)client
{ {
// clean up reading buffer residues
if (!_bpmfReadingBuffer->isEmpty()) {
_bpmfReadingBuffer->clear();
[client setMarkedText:@"" selectionRange:NSMakeRange(0, 0) replacementRange:NSMakeRange(NSNotFound, NSNotFound)];
}
// commit any residue in the composing buffer // commit any residue in the composing buffer
[self commitComposition:client]; [self commitComposition:client];
_currentDeferredClient = nil; _currentDeferredClient = nil;
_currentCandidateClient = nil; _currentCandidateClient = nil;