mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 05:36:35 +00:00
Fix improper integer types, null pointer usage, and memory leaks
This commit is contained in:
parent
3dc53e21e5
commit
23ff50cf4a
@ -731,6 +731,7 @@ static void createMenuBar(void)
|
|||||||
[[appMenu addItemWithTitle:@"Services"
|
[[appMenu addItemWithTitle:@"Services"
|
||||||
action:NULL
|
action:NULL
|
||||||
keyEquivalent:@""] setSubmenu:servicesMenu];
|
keyEquivalent:@""] setSubmenu:servicesMenu];
|
||||||
|
[servicesMenu release];
|
||||||
[appMenu addItem:[NSMenuItem separatorItem]];
|
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||||
[appMenu addItemWithTitle:[NSString stringWithFormat:@"Hide %@", appName]
|
[appMenu addItemWithTitle:[NSString stringWithFormat:@"Hide %@", appName]
|
||||||
action:@selector(hide:)
|
action:@selector(hide:)
|
||||||
@ -749,6 +750,7 @@ static void createMenuBar(void)
|
|||||||
|
|
||||||
NSMenuItem* windowMenuItem =
|
NSMenuItem* windowMenuItem =
|
||||||
[bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
|
[bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
|
||||||
|
[bar release];
|
||||||
NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||||
[NSApp setWindowsMenu:windowMenu];
|
[NSApp setWindowsMenu:windowMenu];
|
||||||
[windowMenuItem setSubmenu:windowMenu];
|
[windowMenuItem setSubmenu:windowMenu];
|
||||||
|
@ -352,7 +352,7 @@ static CFMutableDictionaryRef createMatchingDictionary(long usagePage,
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault,
|
CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault,
|
||||||
kCFNumberIntType,
|
kCFNumberLongType,
|
||||||
&usagePage);
|
&usagePage);
|
||||||
if (pageRef)
|
if (pageRef)
|
||||||
{
|
{
|
||||||
@ -362,7 +362,7 @@ static CFMutableDictionaryRef createMatchingDictionary(long usagePage,
|
|||||||
CFRelease(pageRef);
|
CFRelease(pageRef);
|
||||||
|
|
||||||
CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault,
|
CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault,
|
||||||
kCFNumberIntType,
|
kCFNumberLongType,
|
||||||
&usage);
|
&usage);
|
||||||
if (usageRef)
|
if (usageRef)
|
||||||
{
|
{
|
||||||
@ -421,11 +421,11 @@ void _glfwInitJoysticks(void)
|
|||||||
CFArrayAppendValue(matchingCFArrayRef, matchingCFDictRef);
|
CFArrayAppendValue(matchingCFArrayRef, matchingCFDictRef);
|
||||||
CFRelease(matchingCFDictRef);
|
CFRelease(matchingCFDictRef);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
IOHIDManagerSetDeviceMatchingMultiple(_glfw.iokit_js.managerRef,
|
IOHIDManagerSetDeviceMatchingMultiple(_glfw.iokit_js.managerRef,
|
||||||
matchingCFArrayRef);
|
matchingCFArrayRef);
|
||||||
CFRelease(matchingCFArrayRef);
|
CFRelease(matchingCFArrayRef);
|
||||||
|
}
|
||||||
|
|
||||||
IOHIDManagerRegisterDeviceMatchingCallback(_glfw.iokit_js.managerRef,
|
IOHIDManagerRegisterDeviceMatchingCallback(_glfw.iokit_js.managerRef,
|
||||||
&matchCallback, NULL);
|
&matchCallback, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user