dorianj / CoRD

CoRD is a Mac OS X remote desktop client for Microsoft Windows computers using the RDP protocol. It's easy to use, fast, and free for anyone to use or modify.
http://cord.sourceforge.net/
345 stars 135 forks source link

Comment out ineffective observation #79

Closed ichizok closed 8 years ago

ichizok commented 8 years ago

Quick-fix #75.

1) addObserver doesn't retain observer object.

Thus autoreleasing makes observer release instantly, and dangling pointer causes crash.

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueObserving_Protocol/#//apple_ref/occ/instm/NSObject/addObserver:forKeyPath:options:context:

Neither the receiver, nor anObserver, are retained.

2) Observation of com.apple.keyboard.modifiermapping is ineffective, as the comment goes.

To detect changes, perhaps we can observe com.apple.keyboard.modifiermapping.${VendorID}-${ProductID}-0 of keyboard.