From a5b8c8db18722b86bba3324f942789850ef009bc Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 29 Jan 2012 15:30:43 +0100 Subject: [PATCH] Replaced malloc and free with GLFW allocator. --- src/cocoa_joystick.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index a5560f45..4a2ddeb7 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -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;