forked from enlightenment/enlightenment
When we unbind the data device or input device, we do not need to call
free(). Free the allocated strings after creating the keymap (leak--). Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
77e6d1c8e1
commit
de80a48fc3
|
@ -1122,7 +1122,6 @@ static void
|
||||||
_unbind_data_device(struct wl_resource *resource)
|
_unbind_data_device(struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
wl_list_remove(wl_resource_get_link(resource));
|
wl_list_remove(wl_resource_get_link(resource));
|
||||||
free(resource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1886,16 +1885,14 @@ static void
|
||||||
_e_comp_wl_input_cb_unbind(struct wl_resource *resource)
|
_e_comp_wl_input_cb_unbind(struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
/* remove the link */
|
/* remove the link */
|
||||||
wl_list_remove(&resource->link);
|
wl_list_remove(wl_resource_get_link(resource));
|
||||||
|
|
||||||
/* free the resource */
|
|
||||||
free(resource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct xkb_keymap *
|
static struct xkb_keymap *
|
||||||
_e_comp_wl_input_keymap_get(void)
|
_e_comp_wl_input_keymap_get(void)
|
||||||
{
|
{
|
||||||
E_Config_XKB_Layout *kbd_layout;
|
E_Config_XKB_Layout *kbd_layout;
|
||||||
|
struct xkb_keymap *keymap;
|
||||||
struct xkb_rule_names names;
|
struct xkb_rule_names names;
|
||||||
|
|
||||||
memset(&names, 0, sizeof(names));
|
memset(&names, 0, sizeof(names));
|
||||||
|
@ -1945,7 +1942,13 @@ _e_comp_wl_input_keymap_get(void)
|
||||||
printf("\tModel: %s\n", names.model);
|
printf("\tModel: %s\n", names.model);
|
||||||
printf("\tLayout: %s\n", names.layout);
|
printf("\tLayout: %s\n", names.layout);
|
||||||
|
|
||||||
return xkb_map_new_from_names(_e_wl_comp->xkb.context, &names, 0);
|
keymap = xkb_map_new_from_names(_e_wl_comp->xkb.context, &names, 0);
|
||||||
|
|
||||||
|
free((char *)names.rules);
|
||||||
|
free((char *)names.model);
|
||||||
|
free((char *)names.layout);
|
||||||
|
|
||||||
|
return keymap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue