-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
yes there is a configuration that affects this (and the usual browser related security features)
if using Desktop Recycling then destroy won't be called, as the desktop instance is cached for later reuse.
sometimes the desktop cleanup mechanism is interrupted by browsers (could be the case if an older ZK version is used). In general it works like that (just to give you a few points where to start debugging).
Once the browser closes a tab/reloads a page/navigates to another URL it triggers an onBeforeUnload event. ZK listens to this in order to send a final request to the server to remove the desktop (rmDesktop) which looks like this:
http://server:[port]/appname/zkau?dtid=zab23&cmd0=rmDesktop&opt_0=i
You can verify those events in your browser's network tab (F12 in Chrome and don't forget to enable 'Preserve log') or using other network monitoring tools such as fiddler2 or wireshark.
Without this event (e.g. the browser crashed, or security settings/constraints prevent AJAX calls in onBeforeUnload) ZK doesn't know the client is gone, and keeps the Desktop in the cache until the Session times out, or the max number of desktops per session is reached, or the desktop timeout was exceeded (however a desktop timeout doesn't clean the desktop immediately it merely makes it eligible for GC)
2 | No.2 Revision |
yes there is a configuration that affects this (and the usual browser related security features)
if using Desktop Recycling then destroy won't be called, as the desktop instance is cached for later reuse.
sometimes the desktop cleanup mechanism is interrupted by browsers (could be the case if an older ZK version is used).
In general it works like that (just to give you a few points where to start debugging).
debugging): Once the browser closes a tab/reloads a page/navigates to another URL it triggers an onBeforeUnload event. ZK listens to this in order to send a final request to the server to remove the desktop (rmDesktop) which looks like this:
http://server:[port]/appname/zkau?dtid=zab23&cmd0=rmDesktop&opt_0=i
You can verify those events in your browser's network tab (F12 in Chrome and don't forget to enable 'Preserve log') or using other network monitoring tools such as fiddler2 or wireshark.
Without this event (e.g. the browser crashed, or security settings/constraints prevent AJAX calls in onBeforeUnload) ZK doesn't know the client is gone, and keeps the Desktop in the cache until the Session times out, or the max number of desktops per session is reached, or the desktop timeout was exceeded (however a desktop timeout doesn't clean the desktop immediately it merely makes it eligible for GC)