Skip to content

Commit cd2c8ef

Browse files
committed
notifier/listener: fix change notifiers notifying on listen
Change notifiers should only trigger when notifier_notify is called, not on listen.
1 parent 5e72346 commit cd2c8ef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/notifier_listener.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ struct listener *notifier_listen(struct notifier *notifier, listener_cb_t notify
112112
return NULL;
113113
}
114114

115-
r = listener_notify(l, notifier->state);
116-
if (r == kUnlisten) {
117-
listener_destroy(l);
118-
return NULL;
115+
if (notifier->is_value_notifier) {
116+
r = listener_notify(l, notifier->state);
117+
if (r == kUnlisten) {
118+
listener_destroy(l);
119+
return NULL;
120+
}
119121
}
120122

121123
notifier_lock(notifier);

0 commit comments

Comments
 (0)