Revision: 45800
          http://brlcad.svn.sourceforge.net/brlcad/?rev=45800&view=rev
Author:   brlcad
Date:     2011-08-06 00:31:58 +0000 (Sat, 06 Aug 2011)

Log Message:
-----------
still need to do more, but make a copy of the caller's sketch (in case it's on 
the stack where the  eventual call to bu_free() down in wdb_export() would be 
bad).  this is incomplete since we still should perform a deep copy of the 
caller's struct (including all of the segments).

Modified Paths:
--------------
    brlcad/trunk/src/libwdb/skt.c

Modified: brlcad/trunk/src/libwdb/skt.c
===================================================================
--- brlcad/trunk/src/libwdb/skt.c       2011-08-06 00:25:56 UTC (rev 45799)
+++ brlcad/trunk/src/libwdb/skt.c       2011-08-06 00:31:58 UTC (rev 45800)
@@ -34,9 +34,16 @@
 int
 mk_sketch(struct rt_wdb *fp, const char *name, struct rt_sketch_internal *skt)
 {
+    struct rt_sketch_internal *sketch;
+
     RT_SKETCH_CK_MAGIC(skt);
 
-    return wdb_export(fp, name, (genptr_t)skt, ID_SKETCH, mk_conv2mm);
+    /* copy the caller's struct */
+    BU_GETSTRUCT(sketch, rt_sketch_internal);
+    *sketch = *skt; /* struct copy */
+    /* FIXME: need to perform a deep copy */
+
+    return wdb_export(fp, name, (genptr_t)sketch, ID_SKETCH, mk_conv2mm);
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to