Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to know if a Component in vaadin is disposed?

Jack Hu
9 years ago Feb 11, 2014 5:08am
Christian Schlagkamp
9 years ago Feb 11, 2014 7:11am
Marius Reinwald
9 years ago Feb 11, 2014 10:07am

Depends on what he means with disposed.
When you mean:
1) not attached to a UI anymore: you can check when the Component.detach / DetachListener is called
2) when the variable is set to null: you can just check if(componentA == null)
3) the point when the actual Object in the Stack is removed by the Java Garbage collector: Not really possible to check or at least quite complicated and impractible.

Jack Hu
9 years ago Feb 12, 2014 2:35am