From 1a72245c151f189a41067efae719b46419bad8d8 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 4 May 2005 20:17:28 +0000 Subject: [PATCH] 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. --- simgear/nasal/code.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.39.5