<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
the	O
lapsed	B-Error_Name
listener	I-Error_Name
problem	I-Error_Name
is	O
a	O
common	O
source	O
of	O
memory	B-Error_Name
leaks	I-Error_Name
for	O
object-oriented	B-Language
programming	I-Language
languages	I-Language
,	O
among	O
the	O
most	O
common	O
ones	O
for	O
garbage	B-General_Concept
collected	I-General_Concept
languages	O
.	O
</s>
<s>
It	O
originates	O
in	O
the	O
observer	B-Language
pattern	I-Language
,	O
where	O
observers	O
(	O
or	O
listeners	O
)	O
register	O
with	O
a	O
subject	O
(	O
or	O
publisher	O
)	O
to	O
receive	O
events	O
.	O
</s>
<s>
In	O
basic	O
implementation	O
,	O
this	O
requires	O
both	O
explicit	O
registration	O
and	O
explicit	O
deregistration	O
,	O
as	O
in	O
the	O
dispose	B-Application
pattern	I-Application
,	O
because	O
the	O
subject	O
holds	O
strong	B-General_Concept
references	I-General_Concept
to	O
the	O
observers	O
,	O
keeping	O
them	O
alive	O
.	O
</s>
<s>
Consequently	O
,	O
the	O
subject	O
still	O
holds	O
a	O
reference	O
to	O
the	O
observer	O
which	O
prevents	O
it	O
from	O
being	O
garbage	B-General_Concept
collected	I-General_Concept
—	O
including	O
all	O
other	O
objects	O
it	O
is	O
referring	O
to	O
—	O
for	O
as	O
long	O
as	O
the	O
subject	O
is	O
alive	O
,	O
which	O
could	O
be	O
until	O
the	O
end	O
of	O
the	O
application	O
.	O
</s>
<s>
This	O
causes	O
not	O
only	O
a	O
memory	B-Error_Name
leak	I-Error_Name
,	O
but	O
also	O
a	O
performance	O
degradation	O
with	O
an	O
"	O
uninterested	O
"	O
observer	O
receiving	O
and	O
acting	O
on	O
unwanted	O
events	O
.	O
</s>
<s>
This	O
can	O
be	O
prevented	O
by	O
the	O
subject	O
holding	O
weak	B-General_Concept
references	I-General_Concept
to	O
the	O
observers	O
,	O
allowing	O
them	O
to	O
be	O
garbage	B-General_Concept
collected	I-General_Concept
as	O
normal	O
without	O
needing	O
to	O
be	O
unregistered	O
.	O
</s>
