static void
remote_surrounding_get (WSCContextISF *wsc_ctx)
{
+ if (wsc_ctx && wsc_ctx->im_ctx && wsc_ctx->remote_surrounding_text_fd_read_handler)
+ return;
+
int filedes[2];
if (pipe2(filedes, O_CLOEXEC | O_NONBLOCK) == -1) {
LOGW ("create pipe failed");
+ return;
} else {
LOGD("%d,%d", filedes[0], filedes[1]);
if (wsc_ctx && wsc_ctx->im_ctx) {
close (filedes[1]);
if (wsc_ctx && wsc_ctx->im_ctx) {
- if (wsc_ctx->remote_surrounding_text_fd_read_handler) {
- int fd = ecore_main_fd_handler_fd_get (wsc_ctx->remote_surrounding_text_fd_read_handler);
- close (fd);
- ecore_main_fd_handler_del (wsc_ctx->remote_surrounding_text_fd_read_handler);
- wsc_ctx->remote_surrounding_text_fd_read_handler = NULL;
- }
-
if (wsc_ctx->remote_surrounding_text) {
free (wsc_ctx->remote_surrounding_text);
wsc_ctx->remote_surrounding_text = NULL;