wleepang / DesktopDeployR

A framework for deploying self-contained R-based applications to the desktop
Apache License 2.0
406 stars 120 forks source link

Unable to reopen app after first run #26

Closed parachutedream-s closed 4 years ago

parachutedream-s commented 4 years ago

Hi there,

Every time I run the application and then exit from my web browser, I am unable to re-open it without manually shutting down the "R for Windows front-end" background process in my Task Manager.

Is there a way to ensure that the application stops after the browser is closed?

Thanks

wleepang commented 4 years ago

Your app needs to register an onSessionEnded handler like so:

shinyServer(function(input, output, session){
    ...
    session$onSessionEnded(function() {
        stopApp()
    })
    ...
})