Exiting the App from a ModuleInstall.restored()

View: New views
4 Messages — Rating Filter:   Alert me  

Exiting the App from a ModuleInstall.restored()

by Q Beukes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

So I got my authentication working. I'm putting error handling around my table retrievals that monitors for a special exception thrown only when the authentication hasn't occurred. In such a case I have the installer for each module update it's views (I have data listeners which watch for updates anyway, so it's a relatively easy change).

I have another problem though. When this authentication fails, I notice it in the my app's core module in the restored() method, and instruct the app to close (exit). If I do this with LifecycleManager.exit(), it first saves the application state, which in this case results in a window of 0x0 at position 0x0 to be saved. Next time you open the app and you get a little rectangular shape in the top/left corner. 

I changed to doing System.exit(0); Is there anything unsafe about doing this?

Quintin Beukes

Re: Exiting the App from a ModuleInstall.restored()

by Mario Burdman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I had exactly the same problem some time ago and solved exactly the same way without problems...
But maybe there is a better way of doing this?

--
Mario



On Fri, Oct 30, 2009 at 9:52 AM, Quintin Beukes <quintin@...> wrote:
Hey,

So I got my authentication working. I'm putting error handling around my table retrievals that monitors for a special exception thrown only when the authentication hasn't occurred. In such a case I have the installer for each module update it's views (I have data listeners which watch for updates anyway, so it's a relatively easy change).

I have another problem though. When this authentication fails, I notice it in the my app's core module in the restored() method, and instruct the app to close (exit). If I do this with LifecycleManager.exit(), it first saves the application state, which in this case results in a window of 0x0 at position 0x0 to be saved. Next time you open the app and you get a little rectangular shape in the top/left corner. 

I changed to doing System.exit(0); Is there anything unsafe about doing this?

Quintin Beukes


Re: Exiting the App from a ModuleInstall.restored()

by Jesse Glick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Quintin Beukes wrote:
> in the restored() method [I] instruct
> the app to close (exit). If I do this with LifecycleManager.exit(), it
> first saves the application state, which in this case results in a
> window of 0x0 at position 0x0 to be saved. Next time you open the app
> and you get a little rectangular shape in the top/left corner.

Maybe a bug in core.windows. If reproducible in a small test case please file under platform/window system.

> I changed to doing System.exit(0); Is there anything unsafe about doing
> this?

Possibly; that would bypass all the .close()/.closing() methods, including those which prompt to save any modified files and cleanly terminate running tasks.


Re: Re: Exiting the App from a ModuleInstall.restored()

by Quintin Beukes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Maybe a bug in core.windows. If reproducible in a small test case please file under platform/window system.

Will do.
 

I changed to doing System.exit(0); Is there anything unsafe about doing this?

Possibly; that would bypass all the .close()/.closing() methods, including those which prompt to save any modified files and cleanly terminate running tasks.


Though I'm doing it inside a restored() method which loads at startup in a module, without which no other modules can be loaded. So even if it doesn't happen at startup there will never be any modified files or running tasks.

Q