kivy/kivy — pull request #1405 by eulerreich (2013-08-02 23:49:20+00:00)
Title: Fixed additional memory leak with Bubbles noted in #1388

Original problem: Bubble constructs BubbleContent before finishing its
own construction, thus never initializing its ``_proxy_ref``, causing
``lang.get_proxy`` to return the Bubble itself (this is when creating
handler for BubbleContent's color from parent color). This in turn
caused ``lang._handlers`` to unnecessarily keep it alive.

The fix: I let ``Widget._proxy_ref`` be generated lazily on demand
instead of relying on ``Widget.__init__``: whenever the user calls
``Widget.proxy_ref`` for the first time, ``Widget._proxy_ref`` will be
initialized. I don't see any particular reason to initialize
``_proxy_ref`` only in the ``__init__`.