Fix dangling ptr in thread termination (GH-1845)
Fix dangling ptr in thread termination (GH-1845)

svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape,svaarala/duktape