mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 18:15:10 +00:00
Replaced malloc and free with GLFW allocator.
This commit is contained in:
parent
e05f0c0f53
commit
a5b8c8db18
@ -152,7 +152,7 @@ static void addJoystickElement(_glfwJoystick* joystick, CFTypeRef refElement)
|
||||
long number;
|
||||
CFTypeRef refType;
|
||||
|
||||
_glfwJoystickElement* element = (_glfwJoystickElement*) malloc(sizeof(_glfwJoystickElement));
|
||||
_glfwJoystickElement* element = (_glfwJoystickElement*) _glfwMalloc(sizeof(_glfwJoystickElement));
|
||||
|
||||
CFArrayAppendValue(elementsArray, element);
|
||||
|
||||
@ -238,7 +238,7 @@ static void removeJoystick(_glfwJoystick* joystick)
|
||||
{
|
||||
_glfwJoystickElement* axes =
|
||||
(_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick->Axes, i);
|
||||
free(axes);
|
||||
_glfwFree(axes);
|
||||
}
|
||||
CFArrayRemoveAllValues(joystick->Axes);
|
||||
joystick->NumAxes = 0;
|
||||
@ -247,7 +247,7 @@ static void removeJoystick(_glfwJoystick* joystick)
|
||||
{
|
||||
_glfwJoystickElement* button =
|
||||
(_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick->Buttons, i);
|
||||
free(button);
|
||||
_glfwFree(button);
|
||||
}
|
||||
CFArrayRemoveAllValues(joystick->Buttons);
|
||||
joystick->NumButtons = 0;
|
||||
@ -256,7 +256,7 @@ static void removeJoystick(_glfwJoystick* joystick)
|
||||
{
|
||||
_glfwJoystickElement* hat =
|
||||
(_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick->Hats, i);
|
||||
free(hat);
|
||||
_glfwFree(hat);
|
||||
}
|
||||
CFArrayRemoveAllValues(joystick->Hats);
|
||||
joystick->Hats = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user