Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macOS: fix leak in CurrentKeyboardLayout
Previously, if `layout_data` was not nil, we failed to `CFRelease` `source`. However, if `layout_data` was nil, we dif free source, then immediately set it to a new CoreFoundation object, which we then failed to free. We now use `fml::CFRef` which just does the right thing. Finally, we were returning `(__brdige_transfer)CFRetain(layout_data)` but `__bridge_transfer` releases the transferred object at the end of the enclosing expression, so this is equivalent to `(__bridge)layout_data`, which is what we now do.
- Loading branch information