gm icon indicating copy to clipboard operation
gm copied to clipboard

Do not clear timeout if proc's exitCode is null

Open neinatu opened this issue 5 years ago • 1 comments

I have ImageMagick 6.9.9-9 installed locally and in some case I found that the spawned child process for calling ImageMagick hangs forever and thus calling gm.toBuffer never return, I know this is an issure form ImageMagick but in this case I expect the gm library to kill the spawned process when the timeout option is given. I found that the timer in the cb function get cleared regardless of the exit code from the spawned process. This fix adds check to make sure the timer only get cleared if there is a valid exit code from the spawned process, otherwise the timeout function will be trigged to kill the spawned process after the timeout value elapses.

neinatu avatar Jul 10 '19 15:07 neinatu

Tests failed due to getaddrinfo-enotfound not relevant to code change

neinatu avatar Jul 10 '19 15:07 neinatu

please add a test

aheckmann avatar Sep 19 '22 13:09 aheckmann