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

Calling Contextual.destroy on an instance still references an instance on BeanManager

    Details

    • Steps to Reproduce:
      Hide

      1) Use seam-faces module extension.
      2) Annotate a bean with @ViewScoped
      3) When destroy is called, check Yourkit.

      You will find that there are still references to the instance destroyed (not related to seam-faces).

      Show
      1) Use seam-faces module extension. 2) Annotate a bean with @ViewScoped 3) When destroy is called, check Yourkit. You will find that there are still references to the instance destroyed (not related to seam-faces).
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Avoid the use of new AnnotationLiteral<MyAnnotation>{} in your code. Instead make AnnotationLiterals either top level or static inner classes.

      Show
      Avoid the use of new AnnotationLiteral<MyAnnotation>{} in your code. Instead make AnnotationLiterals either top level or static inner classes.
    • Estimated Difficulty:
      High

      Description

      Using the seam-faces module @ViewScoped extension, when the object is destroyed by Contextual.destroy, weld still references an instance, avoiding being garbage-collected.

      Pseudo Code:

      Contextual contextual = ...
      Object instance = ...
      CreationalContext creational = ...
      contextual.destroy(instance, creational);

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                gastaldi George Gastaldi
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: