summaryrefslogtreecommitdiff
path: root/src/core/signals.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-27 01:18:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-27 01:18:16 +0000
commitb875e2e29df6f335985942f2fd49df8bc80a63cf (patch)
tree3f63efbc084a34dc08f6408e6c9bb0c74f7673cb /src/core/signals.c
parente0bc134d66fcb1c0a901e82973701e652c2b5cd0 (diff)
downloadirssi-b875e2e29df6f335985942f2fd49df8bc80a63cf.zip
signal_stop(); signal_emit("same signal", ...); didn't work. other way
around it did though git-svn-id: http://svn.irssi.org/repos/irssi/trunk@785 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/signals.c')
-rw-r--r--src/core/signals.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/signals.c b/src/core/signals.c
index 2951f471..0fecd5c2 100644
--- a/src/core/signals.c
+++ b/src/core/signals.c
@@ -183,7 +183,11 @@ static int signal_emit_real(SIGNAL_REC *rec, gconstpointer *arglist)
{
SIGNAL_REC *prev_emitted_signal;
SIGNAL_FUNC func;
- int n, index, stopped;
+ int n, index, stopped, stop_emit_count;
+
+ /* signal_stop_by_name("signal"); signal_emit("signal", ...);
+ fails if we compare rec->stop_emit against 0. */
+ stop_emit_count = rec->stop_emit;
stopped = FALSE;
rec->emitting++;
@@ -202,7 +206,7 @@ static int signal_emit_real(SIGNAL_REC *rec, gconstpointer *arglist)
current_emitted_signal = prev_emitted_signal;
}
- if (rec->stop_emit) {
+ if (rec->stop_emit != stop_emit_count) {
stopped = TRUE;
rec->stop_emit--;
n = SIGNAL_LISTS;
@@ -212,9 +216,15 @@ static int signal_emit_real(SIGNAL_REC *rec, gconstpointer *arglist)
}
rec->emitting--;
- if (!rec->emitting && rec->altered) {
- signal_list_clean(rec);
- rec->altered = FALSE;
+ if (!rec->emitting) {
+ if (rec->stop_emit != 0) {
+ /* signal_stop() used too many times */
+ rec->stop_emit = 0;
+ }
+ if (rec->altered) {
+ signal_list_clean(rec);
+ rec->altered = FALSE;
+ }
}
return stopped;