From: andy Date: Wed, 4 May 2005 20:17:28 +0000 (+0000) Subject: Properly release the mod lock when returning from a runtime error. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1a72245c151f189a41067efae719b46419bad8d8;hp=dea7b9050dfc4ae3807213400656996fefc7f60d;p=simgear.git Properly release the mod lock when returning from a runtime error. Ampere discovered that the interpreter would deadlock at runtime if it hit such a condition during initialization. --- diff --git a/simgear/nasal/code.c b/simgear/nasal/code.c index 03cc2707..c7dd68ee 100644 --- a/simgear/nasal/code.c +++ b/simgear/nasal/code.c @@ -678,8 +678,10 @@ naRef naCall(naContext ctx, naRef func, naRef args, naRef obj, naRef locals) // Return early if an error occurred. It will be visible to the // caller via naGetError(). ctx->error = 0; - if(setjmp(ctx->jumpHandle)) + if(setjmp(ctx->jumpHandle)) { + if(!ctx->callParent) naModUnlock(ctx); return naNil(); + } if(IS_CCODE(func.ref.ptr.func->code)) { naCFunction fp = func.ref.ptr.func->code.ref.ptr.ccode->fptr;