Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2693

Beans created via BeanConfigurator have incorrectly handled destroy()


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.8.Final, 4.0.2.Final
    • None
    • None

      When creating beans with BeanConfigurator, users can use a variant that has Instance<T> as parameter and can create another dependent bean instances which should be destroyed when this bean is destroyed.
      However, this isn't currently happening and they are just left behind untouched.

      New dependent beans can be created in both, create and destroy callbacks.

      Note that just adding creationalContext.release() into BeanConfiguratorImpl$ImmutableBean#destroy() doesn't help either because it can lead to double invocation under certain conditions (as described in WELD-1010).

            manovotn Matěj Novotný
            manovotn Matěj Novotný
            0 Vote for this issue
            1 Start watching this issue