MobileChromeApps / chrome-app-developer-tool

Mirror of Apache Cordova app harness
Other
202 stars 33 forks source link

two versions of app harness running? #7

Closed devoncarew closed 10 years ago

devoncarew commented 10 years ago

From a user report, it's possible to get two versions of the app harness running. To repro:

1) open app harness 2) "deploy" an app using USB 3) launch the app 4) press Android's back button. you go to Android home. 5) run app harness again and it says "Could not bind to port 2424".

Possibly fixed in an unreleased version? If so, could we get a new version pushed up? We''' be running through a demo of this and Spark Tuesday, and I want to make sure any potential kicks are worked out. Thanks!

mmocny commented 10 years ago

I'll take a look.

I don't think this is due to two versions of the harness running. I think it may be due to us not cleaning up socket when the application is destroyed and those may not be cleaned up by the system in a timely manner. Can fix this by either by adding onSuspend handler to app-harness, or fixing chrome.socket to clean up on native side even for poorly written apps (note however that Chrome desktop does not clean up chrome.socket automatically).

I'll investigate this to make sure thats the cause first.

mmocny commented 10 years ago

Alright, I confirmed that adding onSuspend to cleanup the socket fixes this issue. Probably we need a more holistic approach to managing/cleaning resources in the harness, but I wanted to get something in for your demo tomorrow. I'll Andrew about releasing a new AH.

devoncarew commented 10 years ago

Awesome, thanks!