mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Cocoa: Fix potential leak of CFNumber object
Spotted by Clang static analysis.
This commit is contained in:
parent
0cc13ceafc
commit
a2674a9034
@ -170,6 +170,8 @@ information on what to include when reporting a bug.
|
|||||||
would abort (#1649)
|
would abort (#1649)
|
||||||
- [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
|
- [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
|
||||||
(#1635)
|
(#1635)
|
||||||
|
- [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays
|
||||||
|
could leak memory
|
||||||
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
||||||
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
||||||
(#1462,#1528)
|
(#1462,#1528)
|
||||||
|
@ -277,14 +277,20 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
|||||||
CFSTR("IOFBCurrentPixelCount"),
|
CFSTR("IOFBCurrentPixelCount"),
|
||||||
kCFAllocatorDefault,
|
kCFAllocatorDefault,
|
||||||
kNilOptions);
|
kNilOptions);
|
||||||
if (!clockRef || !countRef)
|
|
||||||
break;
|
|
||||||
|
|
||||||
uint32_t clock = 0, count = 0;
|
uint32_t clock = 0, count = 0;
|
||||||
CFNumberGetValue(clockRef, kCFNumberIntType, &clock);
|
|
||||||
CFNumberGetValue(countRef, kCFNumberIntType, &count);
|
if (clockRef)
|
||||||
CFRelease(clockRef);
|
{
|
||||||
CFRelease(countRef);
|
CFNumberGetValue(clockRef, kCFNumberIntType, &clock);
|
||||||
|
CFRelease(clockRef);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (countRef)
|
||||||
|
{
|
||||||
|
CFNumberGetValue(countRef, kCFNumberIntType, &count);
|
||||||
|
CFRelease(countRef);
|
||||||
|
}
|
||||||
|
|
||||||
if (clock > 0 && count > 0)
|
if (clock > 0 && count > 0)
|
||||||
refreshRate = clock / (double) count;
|
refreshRate = clock / (double) count;
|
||||||
|
Loading…
Reference in New Issue
Block a user