In the sample on that page, it says:
// Prevent objects from being GC'd
global.app = app;
global.window = window;
Why do you need to do that? I thought that as long as there were still references to an object, it isn't GC'd.