|
|
@ -70,7 +70,7 @@ export function createSubscriber(start) {
|
|
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
return () => {
|
|
|
|
queueMicrotask(() => {
|
|
|
|
queueMicrotask(() => {
|
|
|
|
// Only count down after timeout, else we would reach 0 before our own render effect reruns,
|
|
|
|
// Only count down after a microtask, else we would reach 0 before our own render effect reruns,
|
|
|
|
// but reach 1 again when the tick callback of the prior teardown runs. That would mean we
|
|
|
|
// but reach 1 again when the tick callback of the prior teardown runs. That would mean we
|
|
|
|
// re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.
|
|
|
|
// re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.
|
|
|
|
subscribers -= 1;
|
|
|
|
subscribers -= 1;
|
|
|
|