Revision: 54447
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54447&view=rev
Author:   n_reed
Date:     2013-02-21 01:09:49 +0000 (Thu, 21 Feb 2013)
Log Message:
-----------
make tk vls string creation dependent on having tk; remember to free on return

Modified Paths:
--------------
    brlcad/trunk/src/libtclcad/tclcadAutoPath.c

Modified: brlcad/trunk/src/libtclcad/tclcadAutoPath.c
===================================================================
--- brlcad/trunk/src/libtclcad/tclcadAutoPath.c 2013-02-21 00:54:58 UTC (rev 
54446)
+++ brlcad/trunk/src/libtclcad/tclcadAutoPath.c 2013-02-21 01:09:49 UTC (rev 
54447)
@@ -180,10 +180,12 @@
     char pathsep[2] = { BU_PATH_SEPARATOR, '\0' };
 
     struct bu_vls tcl = BU_VLS_INIT_ZERO;
+    struct bu_vls itcl = BU_VLS_INIT_ZERO;
+#ifdef HAVE_TK
     struct bu_vls tk = BU_VLS_INIT_ZERO;
-    struct bu_vls itcl = BU_VLS_INIT_ZERO;
     struct bu_vls itk = BU_VLS_INIT_ZERO;
     struct bu_vls iwidgets = BU_VLS_INIT_ZERO;
+#endif
 
     if (!interp) {
        /* nothing to do */
@@ -191,10 +193,12 @@
     }
 
     bu_vls_printf(&tcl, "tcl%s", TCL_VERSION);
+    bu_vls_printf(&itcl, "itcl%s", ITCL_VERSION);
+#ifdef HAVE_TK
     bu_vls_printf(&tk, "tk%s", TK_VERSION);
-    bu_vls_printf(&itcl, "itcl%s", ITCL_VERSION);
     bu_vls_printf(&itk, "itk%s", ITK_VERSION);
     bu_vls_printf(&iwidgets, "iwidgets%s", IWIDGETS_VERSION);
+#endif
 
     root = bu_brlcad_root("", 1);
     bu_vls_printf(&root_buf, "%s", root);
@@ -419,6 +423,13 @@
     }
 
     which_argv = NULL;
+    bu_vls_free(&tcl);
+    bu_vls_free(&itcl);
+#ifdef HAVE_TK
+    bu_vls_free(&tk);
+    bu_vls_free(&itk);
+    bu_vls_free(&iwidgets);
+#endif
     bu_vls_free(&auto_path);
     bu_vls_free(&lappend);
     bu_vls_free(&root_buf);

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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to