Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-387

EnvironmentLoader destroys wrong environment

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.2.2
    • Component/s: Web
    • Labels:
      None

      Description

      I've got a singleton EnvironmentLoader that is used to create multiple environments for multiple servlet contexts. Initialization goes all well but destroying is done to the last created environment and not to the one that resides in given servlet context.

      A simple fix/workaroud would be to change the destroyEnvironment as

      Object environment = servletContext.getAttribute(ENVIRONMENT_ATTRIBUTE_KEY);
      LifecycleUtils.destroy(environment);
      

      Instance variable reference to last initialized environment should also be removed to allow garbage to be collected after last environment has been destroyed.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tuomas_kiviaho Tuomas Kiviaho
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: