Opened 4 years ago

Closed 3 years ago

#11372 closed defect (wontfix)

VaadinPortlet should implement destroy()

Reported by: dnebing Owned by: ticketmaster
Priority: undefined Milestone:
Component: Core Framework Version: 7.0.2
Keywords: Cc: dnebing@…
Depends on:
Fv: no


VaadinPortlet does not implement destroy() so the CurrentInstance leaves artifacts in memory (memory leak) when destroyed.

VaadinPortlet should implement the destroy() method and should invoke a new method on CurrentInstance to clean up and destroy the thread local.

Change history (5)

comment:1 Changed 4 years ago by dnebing

  • Cc dnebing@… added

comment:2 Changed 4 years ago by dnebing

Should also probably add a portletDestroyed() method to allow subclasses to clean up resources, modeled after the portletInitialized() method to allow subclasses to initialize themselves.

comment:3 Changed 4 years ago by Artur Signell

  • Component changed from undefined to Core Framework

comment:4 Changed 3 years ago by Leif Astrand

  • Resolution set to wontfix
  • Status changed from new to closed

Clearing CurrentInstance in destroy() would only clean up the ThreadLocal of the thread where destroy() is run whereas any leaked CurrentInstance on other threads would still be there. The ThreadLocal API does not seem to allow accessing a ThreadLocal of another thread.

The correct way of avoiding leaks is to make sure CurrentInstance.clearAll() is run in a finally block in all places where there might be code that has set any instance. #11906 will fix this for VaadinServlet.init() and VaadinPortlet.init().

Please create separate tickets for any other situations where CurrentInstance.clearAll() might be missing.

comment:5 Changed 2 years ago by Artur Signell

  • Fv unset
Note: See TracTickets for help on using tickets.