call_data->icid = base_icid ++;
- x11ic = g_new0 (X11IC, 1);
+ x11ic = g_slice_new0 (X11IC);
x11ic->icid = call_data->icid;
x11ic->connect_id = call_data->connect_id;
x11ic->conn = (X11ICONN *)g_hash_table_lookup (_connections,
(gconstpointer)(unsigned long)call_data->icid);
ibus_im_client_release_input_context (_client, x11ic->ibus_ic);
- g_hash_table_remove (_ibus_ic_table, x11ic->ibus_ic);
- g_free (x11ic->ibus_ic);
-
- x11ic->conn->clients = g_list_remove (x11ic->conn->clients, (gconstpointer)x11ic);
+ g_hash_table_remove (_ibus_ic_table, x11ic->ibus_ic);
g_hash_table_remove (_x11_ic_table,
(gconstpointer)(unsigned long)call_data->icid);
+ x11ic->conn->clients = g_list_remove (x11ic->conn->clients, (gconstpointer)x11ic);
- g_free (x11ic);
+ g_free (x11ic->ibus_ic);
+ g_slice_free (X11IC, x11ic);
return 1;
}
g_return_val_if_fail (conn == NULL, 1);
- conn = g_new0(X11ICONN, 1);
+ conn = g_slice_new0 (X11ICONN);
g_hash_table_insert (_connections,
(gpointer)(unsigned long)call_data->connect_id,
g_hash_table_remove (_x11_ic_table,
(gconstpointer)(unsigned long)x11ic->icid);
- g_free (x11ic);
+ g_slice_free (X11IC, x11ic);
}
int
g_hash_table_remove (_connections, (gconstpointer)(unsigned long)call_data->connect_id);
- g_free (conn);
+ g_slice_free (X11ICONN, conn);
return 1;
}
static KeyPressCallData *
_key_press_call_data_new (IBusIMClient *client, const gchar *ic, GdkEvent *event)
{
- KeyPressCallData *p = g_new (KeyPressCallData, 1);
+ KeyPressCallData *p = g_slice_new (KeyPressCallData);
p->client = g_object_ref (client);
p->ic = g_strdup (ic);
p->event = gdk_event_copy (event);
g_free (p->ic);
gdk_event_free (p->event);
}
- g_free (p);
+ g_slice_free (KeyPressCallData, p);
}
static void