Created
March 24, 2020 13:10
-
-
Save mattn/8cb49a86b74559a10bccd753785e42d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/channel.c b/src/channel.c | |
index 6dde107bf..fdb115a11 100644 | |
--- a/src/channel.c | |
+++ b/src/channel.c | |
@@ -4431,6 +4431,7 @@ channel_parse_messages(void) | |
ELAPSED_INIT(start_tv); | |
#endif | |
+ static int freeing = FALSE; | |
++safe_to_invoke_callback; | |
@@ -4452,16 +4453,16 @@ channel_parse_messages(void) | |
channel = first_channel; | |
continue; | |
} | |
- if (channel->ch_to_be_freed || channel->ch_killing) | |
+ if ((channel->ch_to_be_freed || channel->ch_killing) && freeing == FALSE) | |
{ | |
if (channel->ch_killing) | |
{ | |
+ freeing = TRUE; | |
channel_free_contents(channel); | |
- channel_free_channel(channel); | |
+ freeing = FALSE; | |
channel->ch_job->jv_channel = NULL; | |
} | |
- else | |
- channel_free(channel); | |
+ channel_free(channel); | |
// channel has been freed, start over | |
channel = first_channel; | |
continue; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment