[gnome-games/wip/aplazas/gamepad-event: 2/14] gamepad: Fix NULL checks in gamepadmapping destructor
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/gamepad-event: 2/14] gamepad: Fix NULL checks in gamepadmapping destructor
- Date: Sat, 13 May 2017 09:37:16 +0000 (UTC)
commit 18d68362de38af118d205f2225f6a182d9f2152f
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri May 12 21:52:02 2017 +0200
gamepad: Fix NULL checks in gamepadmapping destructor
We want to free non-NULL pointers, not NULL ones.
https://bugzilla.gnome.org/show_bug.cgi?id=782549
src/gamepad/gamepad-mapping.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gamepad/gamepad-mapping.c b/src/gamepad/gamepad-mapping.c
index 36460aa..8e17bb6 100644
--- a/src/gamepad/gamepad-mapping.c
+++ b/src/gamepad/gamepad-mapping.c
@@ -437,11 +437,11 @@ finalize (GObject *obj)
self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_GAMEPAD_MAPPING, GamesGamepadMapping);
- if (self->buttons == NULL)
+ if (self->buttons != NULL)
g_array_free (self->buttons, TRUE);
- if (self->axes == NULL)
+ if (self->axes != NULL)
g_array_free (self->axes, TRUE);
- if (self->dpads == NULL)
+ if (self->dpads != NULL)
g_array_free (self->dpads, TRUE);
G_OBJECT_CLASS (games_gamepad_mapping_parent_class)->finalize (obj);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]