]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/misc.c
First working version of DOM like Canvas event handling
[simgear.git] / simgear / nasal / misc.c
index 8640aea09769c2b90bc5c17f796cb8d7a7a5058f..dae0bfe48feae8fe8ea1379677f87a591b9d4da3 100644 (file)
@@ -121,12 +121,25 @@ naRef naNewFunc(struct Context* c, naRef code)
 
 naRef naNewGhost(naContext c, naGhostType* type, void* ptr)
 {
-    naRef ghost = naNew(c, T_GHOST);
+    naRef ghost;
+    // ensure 'simple' ghost users don't see garbage for these fields
+    type->get_member = 0;
+    type->set_member = 0;
+    
+    ghost = naNew(c, T_GHOST);
     PTR(ghost).ghost->gtype = type;
     PTR(ghost).ghost->ptr = ptr;
     return ghost;
 }
 
+naRef naNewGhost2(naContext c, naGhostType* t, void* ptr)
+{
+    naRef ghost = naNew(c, T_GHOST);
+    PTR(ghost).ghost->gtype = t;
+    PTR(ghost).ghost->ptr = ptr;
+    return ghost;
+}
+
 naGhostType* naGhost_type(naRef ghost)
 {
     if(!IS_GHOST(ghost)) return 0;