NWJS not completely closing when exiting app

Bugs will be moved here once resolved.

Post » Mon Feb 01, 2016 7:41 am

-snip, just fixed with Alex's fix, thanks-
B
20
S
5
Posts: 107
Reputation: 1,471

Post » Wed Feb 10, 2016 7:12 pm

Ashley wrote:I think this is to do with NW.js 0.12 upgrades. The data folder NW.js 0.12 uses seems to have been in a different format to the one NW 0.13 uses, so if you in-place upgrade an app then it uses the 0.12 data folder in a 0.13 app and that seems to cause some weird issues (mostly just ghost processes, but I've seen one or two other related issues). Renaming the project causes it to start using a new empty data folder (because the data folder name is based on the project name). This fixes it and also explains why I can't reproduce the problem, because I'm just testing fresh 0.13 apps which work fine. Either way, it's a NW.js issue so it would probably be better to take this to the NW.js issue tracker, but we'd probably need a good repro for the NW.js devs. So, is anyone able to make a repro for this based on running a NW.js 0.12 app and then updating it to 0.13?


I started dissecting my project to see if I could create a capx for a bug. I renamed the project, then I removed all my sounds, and the Audio plug as I was planning to redoing all that anyway.
I exported it, and both 32, and 64 bit did not have the ghost process.
I then added one sound back with the Audio plug with an event to play it.*
No extra process was there after I tested that export.

*I noted that there were still references to the deleted sounds in the event commands.
No I did not close C2 before doing this.
Image ImageImage
B
165
S
49
G
147
Posts: 8,047
Reputation: 96,586

Post » Fri Feb 12, 2016 12:50 pm

Hey all,

I noticed that putting the task kill within the game doesn't always get rid of the extra process.

You are better off running your windows executable through a script.

Create a file called rungame.vbs and put the following in (replace nw.exe with your game's exe on lines 2 and 4):

Code: Select all
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "nw.exe", 1, true
WScript.Sleep 500
WshShell.Run "taskkill /f /im nw.exe", 1, true


Next create a GameLauncher.bat file with the following one line:

Code: Select all
cscript rungame.vbs


Put both the vbs and bat files in your win32 and win64 directories.

Instruct your users to double click GameLauncher.bat to run your game. This ensures the game is actually closed and runs the task kill process.

Note: If you game's exe contains a space (you evil person you), you must add quotation marks to the vbs script like so:

Code: Select all
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """My Game.exe""", 1, true
WScript.Sleep 500
WshShell.Run "taskkill /f /im ""My Game.exe""", 1, true
B
29
S
6
G
1
Posts: 80
Reputation: 2,450

Post » Fri Feb 12, 2016 2:25 pm

I have to say, any method by which you try to forcibly shut down the leftover processes is an appalling hack, and could just open another can of worms (e.g. do all users have permission to use VBScript? Is it always installed? Are its dependencies the same as NW.js?), not to mention being a classic treat-the-symptoms solution rather than fixing the real problem. It would be far better to put effort in to finding a repro that could be submitted to the NW.js developers as I said in my previous post.
Scirra Founder
B
382
S
223
G
86
Posts: 23,991
Reputation: 189,739

Post » Tue Feb 16, 2016 12:21 am

Look! I had the same problem mentioned here!

NW.js ghost and random crashes, random fps drop in NW.js! That worried me a lot, because in NW.js v12 my project worked perfect!

Already NW.js v13 beta 4 not!

It was a while without updating the windows 8, I had disabled the Windows update. I activated yesterday to upgrade to upgrade the Windows and the problems have been corrected!

Then I recommend updating the Windows if not doing it! (You can stop your headache!)



PS: NW.js ghosts after closing still continue! the other problems have been fixed after activate Windows update and upgrade!
The developer of Dunar: Dimension Two



2017-Thistom Studios Software
B
20
S
4
G
4
Posts: 29
Reputation: 4,091

Post » Tue Feb 16, 2016 6:29 pm

Hey Drew, I was just about to report the same bug when I realized you had posted already lol

The last version of Node Webkit I had which didnt have this bug was version alpha 7.

To successfuly revert to an older version, download it here http://downloads.scirra.com/nwjs/nwjs-f ... alpha7.exe
Delete all the files at C:\Program Files\NWjsForC2 (VERY IMPORTANT, I didn't do this the first time, and basically C2 looks at whatever files are present here to create its own nwjs files from on export)
Then run the downloaded nwjs version.

I personally havnt tried this, but i do remember not having this issue until the Beta. A lot of my customers have complained about this already, so I will be trying it today

https://github.com/nwjs/nw.js/issues/984

Okay looks like someone already reported the issue on github, but this was years ago... The lead programmer of Roger Wang has looked over this issue. I might try to repost the issue again
B
19
S
2
Posts: 70
Reputation: 1,411

Post » Wed Feb 17, 2016 10:11 am

Thanks for posting the issue again, it'll be good to keep track of the progress!
B
141
S
68
G
17
Posts: 1,769
Reputation: 20,124

Post » Thu Feb 18, 2016 10:08 pm

Hi,

I make some test with a new action for NW.JS plugin "CloseApp"
Image

and I don't have this issue
If someone want to test the exported files
-> CloseAppTestNw13B5win32
-> CloseAppTestNw13B5win64
Image Image
B
19
S
10
G
121
Posts: 865
Reputation: 62,933

Post » Mon Feb 22, 2016 9:43 pm

MadSpy wrote:Hi,

I make some test with a new action for NW.JS plugin "CloseApp"
Image

and I don't have this issue
If someone want to test the exported files
-> CloseAppTestNw13B5win32
-> CloseAppTestNw13B5win64


I dont have a close app action on my NWJS. Which version do you have?
Image
B
64
S
17
G
8
Posts: 531
Reputation: 12,849

Post » Mon Feb 22, 2016 9:51 pm

modified plugin; but you can test with the CloseAppTestNw13B5(win32 or win64) app with steam (create a new depot/build, upload and run by steam)
runs the app, close and check if the exe is still running in taskmanger
Image Image
B
19
S
10
G
121
Posts: 865
Reputation: 62,933

PreviousNext

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest