From f0ba2aaec3d57fab949c9280a814368d24cf32e7 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Sat, 7 May 2016 00:28:57 -0700 Subject: [PATCH] Fix channel --- src/MacVim/MMBackend.m | 3 +-- src/channel.c | 6 ++++++ src/proto/channel.pro | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index 733f32e5b9..9caf92a56b 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -3416,6 +3416,7 @@ static id evalExprCocoa(NSString * expr, NSString ** errstr) - (void)dealloc { + CFSocketInvalidate(socket); CFRunLoopSourceInvalidate(runLoopSource); CFRelease(runLoopSource); CFRelease(socket); @@ -3459,9 +3460,7 @@ static void socketReadCallback(CFSocketRef s, - (void)read { -#ifdef FEAT_CHANNEL channel_read(channel, part, "MMChannel_read"); -#endif } @end diff --git a/src/channel.c b/src/channel.c index 2ae3e01944..214ee924af 100644 --- a/src/channel.c +++ b/src/channel.c @@ -54,7 +54,9 @@ # define fd_close(sd) close(sd) #endif +#ifndef FEAT_GUI_MACVIM static void channel_read(channel_T *channel, int part, char *func); +#endif /* Whether a redraw is needed for appending a line to a buffer. */ static int channel_need_redraw = FALSE; @@ -2824,7 +2826,11 @@ channel_close_on_error(channel_T *channel, char *func) * "part" is PART_SOCK, PART_OUT or PART_ERR. * The data is put in the read queue. */ +#ifndef FEAT_GUI_MACVIM static void +#else + void +#endif channel_read(channel_T *channel, int part, char *func) { static char_u *buf = NULL; diff --git a/src/proto/channel.pro b/src/proto/channel.pro index 5e0bec54b5..f7853d1e60 100644 --- a/src/proto/channel.pro +++ b/src/proto/channel.pro @@ -60,4 +60,7 @@ job_T *job_start(typval_T *argvars); char *job_status(job_T *job); void job_info(job_T *job, dict_T *dict); int job_stop(job_T *job, typval_T *argvars); +#ifdef FEAT_GUI_MACVIM +void channel_read(channel_T *channel, int part, char *func); +#endif /* vim: set ft=c : */