]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/gc.c
Clamp pitch values rather than just dumping an error message.
[simgear.git] / simgear / nasal / gc.c
index 8fa2b9c5326b96312f9f70a9b06305540eec0b83..60f6c4223785c1f476bed9733f5acfb6d0993fbe 100644 (file)
@@ -41,6 +41,12 @@ static void naCode_gcclean(struct naCode* o)
     naFree(o->constants); o->constants = 0;
 }
 
+static void naGhost_gcclean(struct naGhost* g)
+{
+    if(g->ptr) g->gtype->destroy(g->ptr);
+    g->ptr = 0;
+}
+
 static void freeelem(struct naPool* p, struct naObj* o)
 {
     // Mark the object as "freed" for debugging purposes
@@ -61,6 +67,9 @@ static void freeelem(struct naPool* p, struct naObj* o)
     case T_CODE:
         naCode_gcclean((struct naCode*)o);
         break;
+    case T_GHOST:
+        naGhost_gcclean((struct naGhost*)o);
+        break;
     }
 
     // And add it to the free list