Cbhm_Received_Data *received_data;
Cbhm_Data_Offer *cbhm_data_offer;
bool data_receive;
- int pipe[2];
} Cbhm_Glib_Info;
static void
receive_data_done:
g_source_remove_poll(&info->gsource, &info->datafd);
+ close(info->datafd.fd);
info->datafd.fd = -1;
info->data_receive = false;
- close(info->pipe[1]);
_cbhm_set_selection(info);
}
if (offer == NULL) {
INF("[CBHM]_data_device_cb_selection: previous selection cancelled\n");
if (info->data_receive == true) {
- WRN("[CBHM]_data_device_cb_selection: stop receive(%d, %d)\n", info->datafd.fd, info->pipe[1]);
+ WRN("[CBHM]_data_device_cb_selection: stop receive(%d)\n", info->datafd.fd);
g_source_remove_poll(&info->gsource, &info->datafd);
+ close(info->datafd.fd);
info->datafd.fd = -1;
info->data_receive = false;
- close(info->pipe[1]);
}
}
if (cbhm_data_offer->data_offer != offer) {
info->received_data = NULL;
wl_data_offer_receive(offer, (const char *)mime_type, pipe[1]);
+ close(pipe[1]);
wl_display_flush(info->wl_disp);
g_source_add_poll(&info->gsource, &info->datafd);
DBG("[CBHM]_data_device_cb_selection: set datafd(%d, %d)\n", pipe[0], pipe[1]);
- info->pipe[0] = pipe[0];
- info->pipe[1] = pipe[1];
}
static const struct wl_data_device_listener _data_device_listener =
}
info->cbhm_data_offer = NULL;
if (info->datafd.fd != -1) {
+ close(info->datafd.fd);
info->datafd.fd = -1;
- close(info->pipe[1]);
}
cbhm_wayland_shutdown(info);
g_source_destroy(source);
}
info->cbhm_data_offer = NULL;
if (info->datafd.fd != -1) {
+ close(info->datafd.fd);
info->datafd.fd = -1;
- close(info->pipe[1]);
}
cbhm_wayland_shutdown(info);