]> git.mxchange.org Git - simgear.git/commitdiff
Properly release the mod lock when returning from a runtime error.
authorandy <andy>
Wed, 4 May 2005 20:17:28 +0000 (20:17 +0000)
committerandy <andy>
Wed, 4 May 2005 20:17:28 +0000 (20:17 +0000)
Ampere discovered that the interpreter would deadlock at runtime if it
hit such a condition during initialization.

simgear/nasal/code.c

index 03cc2707324dcaeb80178e3edce51bfce80c3755..c7dd68ee5a28b66004f1dbef2312ed9bdd278791 100644 (file)
@@ -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;