]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/parse.c
Update the code a bit more, add a function to retreive the last error string and...
[simgear.git] / simgear / nasal / parse.c
index a17452c49c707a9760ef5b99489a84422d51b79b..920d7342acbaaa4642a1d7a7c994c6a157359a3d 100644 (file)
@@ -489,6 +489,9 @@ naRef naParseCode(struct Context* c, naRef srcFile, int firstLine,
     struct Token* t;
     struct Parser p;
 
+    // Protect from garbage collection
+    naVec_append(c->temps, srcFile);
+
     // Catch parser errors here.
     *errLine = 0;
     if(setjmp(p.jumpHandle)) {
@@ -520,6 +523,7 @@ naRef naParseCode(struct Context* c, naRef srcFile, int firstLine,
 
     // Clean up our mess
     naParseDestroy(&p);
+    naVec_append(c->temps, codeObj);
 
     return codeObj;
 }