Daniele Bartolini пре 10 година
родитељ
комит
0a81976c47
3 измењених фајлова са 7 додато и 7 уклоњено
  1. 2 2
      src/input/input_device.cpp
  2. 1 1
      src/input/input_device.h
  3. 4 4
      src/input/input_manager.cpp

+ 2 - 2
src/input/input_device.cpp

@@ -165,9 +165,9 @@ InputDevice* InputDevice::create(Allocator& a, const char* name, u8 num_buttons,
 	return id;
 }
 
-void InputDevice::destroy(Allocator& a, InputDevice* id)
+void InputDevice::destroy(Allocator& a, InputDevice& id)
 {
-	a.deallocate(id);
+	a.deallocate(&id);
 }
 
 } // namespace crown

+ 1 - 1
src/input/input_device.h

@@ -81,7 +81,7 @@ public:
 	void update();
 
 	static InputDevice* create(Allocator& a, const char* name, u8 num_buttons, u8 num_axes, const char** button_names, const char** axis_names);
-	static void destroy(Allocator& a, InputDevice* id);
+	static void destroy(Allocator& a, InputDevice& id);
 };
 
 } // namespace crown

+ 4 - 4
src/input/input_manager.cpp

@@ -205,11 +205,11 @@ InputManager::InputManager(Allocator& a)
 InputManager::~InputManager()
 {
 	for (u8 i = 0; i < CROWN_MAX_JOYPADS; ++i)
-		InputDevice::destroy(*_allocator, _joypad[i]);
+		InputDevice::destroy(*_allocator, *_joypad[i]);
 
-	InputDevice::destroy(*_allocator, _touch);
-	InputDevice::destroy(*_allocator, _mouse);
-	InputDevice::destroy(*_allocator, _keyboard);
+	InputDevice::destroy(*_allocator, *_touch);
+	InputDevice::destroy(*_allocator, *_mouse);
+	InputDevice::destroy(*_allocator, *_keyboard);
 }
 
 InputDevice* InputManager::keyboard()