diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-12-18 13:12:41 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-12-18 13:12:41 -0300 |
commit | d049be950cfaca6311b575890e81521d62db68d7 (patch) | |
tree | 8d31fc0502320e37b189535ec3d004e911b31e5f /src | |
parent | df9dc2cb77720b9b78ad87559657c14874d0b676 (diff) |
Warn of plugin bugs
Diffstat (limited to 'src')
-rw-r--r-- | src/common/plugin.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c index e15e94bb..5524e984 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -612,6 +612,9 @@ plugin_hook_run (session *sess, char *name, char *word[], char *word_eol[], break; } + if ((ret & mask) != ret) { + g_critical("plugin tried to eat cleanup hooks"); + } ret &= mask; if ((ret & HEXCHAT_EAT_HEXCHAT) && (ret & HEXCHAT_EAT_PLUGIN)) @@ -1151,12 +1154,16 @@ hexchat_get_context (hexchat_plugin *ph) int hexchat_set_context (hexchat_plugin *ph, hexchat_context *context) { - if (is_session (context)) + if (context == NULL) { + return 0; + } + if (!is_session (context)) { - ph->context = context; - return 1; + g_critical("plugin tried to set an invalid context"); + return 0; } - return 0; + ph->context = context; + return 1; } hexchat_context * |