Index: xotcl/ChangeLog
===================================================================
diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/ChangeLog	(.../ChangeLog)	(revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd)
+++ xotcl/ChangeLog	(.../ChangeLog)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -1,3 +1,11 @@
+2004-11-14 Gustaf.Neumann@wu-wien.ac.at
+        * fixed yet another free memory read 
+          (many thanks for Zoran for help with purify)
+2004-11-13 Gustaf.Neumann@wu-wien.ac.at
+        * fixed entries for aolserver in configure.in 
+          (many thanks for Zoran reporting this problem)
+        * fixed --enable symbols (many thanks for Zoran reporting this problem)
+        * fixed free memory read in namespace deletes
 2004-10-30 Gustaf.Neumann@wu-wien.ac.at
         * added error message when someone tries to delete a
           non-existing proc/instproc
Index: xotcl/Makefile
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/Makefile	(.../Makefile)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/Makefile	(.../Makefile)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -12,7 +12,7 @@
 # See the file "license.terms" for information on usage and redistribution
 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 #
-# RCS: @(#) $Id: Makefile,v 1.23 2004/11/14 01:07:17 neumann Exp $
+# RCS: @(#) $Id: Makefile,v 1.24 2004/11/14 17:36:36 neumann Exp $
 
 #========================================================================
 # Add additional lines to handle any additional AC_SUBST cases that
@@ -29,7 +29,7 @@
 src_generic_dir = ${srcdir}/generic
 PLATFORM_DIR    = $(srcdir)/unix
 target_doc_dir 	= ./doc
-TCL_LIB_SPEC    = -L/home/neumann/import/tcl8.4.7/unix -ltcl8.4
+TCL_LIB_SPEC    = -L/home/neumann/tcl8.4.7/unix -ltcl8.4
 TK_LIB_SPEC	= 
 subdirs		= 
 aol_prefix	= /usr/local/aolserver
@@ -120,7 +120,7 @@
 PACKAGE_NAME	= xotcl
 PACKAGE_VERSION	= 1.3.3
 CC		= gcc -pipe
-CFLAGS_DEFAULT	= -g
+CFLAGS_DEFAULT	= -O
 CFLAGS_WARNING	= -Wall -Wconversion -Wno-implicit-int
 CLEANFILES	= *.o *.a *.so *~ core gmon.out config.*
 EXEEXT		= 
@@ -135,11 +135,11 @@
 SHLIB_CFLAGS	= -fPIC
 SHLIB_LD	= gcc -pipe -shared
 SHLIB_LD_FLAGS	= 
-SHLIB_LD_LIBS	= ${LIBS} -L/home/neumann/import/tcl8.4.7/unix -ltclstub8.4
+SHLIB_LD_LIBS	= ${LIBS} -L/home/neumann/tcl8.4.7/unix -ltclstub8.4
 STLIB_LD	= ${AR} cr
-TCL_DEFS	=  -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DHAVE_READDIR_R=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 
+TCL_DEFS	=  -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DHAVE_READDIR_R=1 -DSTATIC_BUILD=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 
 TCL_BIN_DIR	= /home/neumann/tcl8.4.7/unix
-TCL_SRC_DIR	= /home/neumann/import/tcl8.4.7
+TCL_SRC_DIR	= /home/neumann/tcl8.4.7
 # This is necessary for packages that use private Tcl headers
 #TCL_TOP_DIR_NATIVE	= $(TCL_SRC_DIR)
 # Not used, but retained for reference of what libs Tcl required
Index: xotcl/configure
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/configure	(.../configure)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/configure	(.../configure)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -6840,7 +6840,7 @@
 fi
 
 aol_prefix="/usr/local/aolserver"
-if test -d "${prefix}/modules/tcl" ; then aol_prefix="$(prefix)" ; fi
+if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi
 
 
 #--------------------------------------------------------------------
Index: xotcl/configure.in
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/configure.in	(.../configure.in)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/configure.in	(.../configure.in)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -164,7 +164,7 @@
 fi
 
 aol_prefix="/usr/local/aolserver"
-if test -d "${prefix}/modules/tcl" ; then aol_prefix="$(prefix)" ; fi
+if test -d "${prefix}/modules/tcl" ; then aol_prefix="${prefix}" ; fi
 AC_SUBST(aol_prefix)
 
 #--------------------------------------------------------------------
Index: xotcl/doc/xo-daemon.html
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/doc/xo-daemon.html	(.../xo-daemon.html)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/doc/xo-daemon.html	(.../xo-daemon.html)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -76,7 +76,7 @@
           <em> Date:</em>
         </TD>
         <TD VALIGN="top">
-          [::xotcl::rcs date {$Date: 2004/11/14 01:07:17 $}]
+          [::xotcl::rcs date {$Date: 2004/11/14 17:36:36 $}]
         </TD>
       </TR>
     </TABLE>
Index: xotcl/doc/xo-whichPkg.html
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/doc/xo-whichPkg.html	(.../xo-whichPkg.html)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/doc/xo-whichPkg.html	(.../xo-whichPkg.html)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -52,7 +52,7 @@
           <em> Date:</em>
         </TD>
         <TD VALIGN="top">
-          [::xotcl::rcs date {$Date: 2004/11/14 01:07:17 $}]
+          [::xotcl::rcs date {$Date: 2004/11/14 17:36:36 $}]
         </TD>
       </TR>
     </TABLE>
Index: xotcl/generic/xotcl.c
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/generic/xotcl.c	(.../xotcl.c)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/generic/xotcl.c	(.../xotcl.c)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -1,4 +1,4 @@
-/* $Id: xotcl.c,v 1.28 2004/11/14 01:07:17 neumann Exp $
+/* $Id: xotcl.c,v 1.29 2004/11/14 17:36:36 neumann Exp $
  *
  *  XOTcl - Extended OTcl
  *
@@ -1371,9 +1371,11 @@
 NSNamespaceDeleteProc(ClientData clientData) {
   /* dummy for ns identification by pointer comparison */
   XOTclObject *obj = (XOTclObject*) clientData;  
-  /*fprintf(stderr,"namespacedeleteproc %p\n",clientData);*/
-  obj->flags |= XOTCL_NS_DESTROYED;
-  obj->nsPtr = NULL;
+  /*fprintf(stderr,"namespacedeleteproc obj=%p\n",clientData);*/
+  if (obj) {
+    obj->flags |= XOTCL_NS_DESTROYED;
+    obj->nsPtr = NULL;
+  }
 }
 
 void
@@ -1392,11 +1394,13 @@
   }
 
   Tcl_Namespace_activationCount(nsPtr) = activationCount;
+
   /*
   fprintf(stderr, "to %d. \n", nsp->activationCount);
   */
   MEM_COUNT_FREE("TclNamespace",nsPtr);
   if (Tcl_Namespace_deleteProc(nsPtr) != NULL) {
+    /*fprintf(stderr,"calling deteteNamespace\n");*/
     Tcl_DeleteNamespace(nsPtr);
   }
 }
@@ -4184,6 +4188,9 @@
     
     /* if no filter/mixin is found => do ordinary method lookup */
     if (proc == 0) {
+      /*
+      fprintf(stderr,"ordinary lookup for obj %p method %s nsPtr %p\n",
+      obj, methodName, obj->nsPtr);*/
       /*if (obj->nsPtr && !(obj->flags & XOTCL_NS_DESTROYED))*/
       if (obj->nsPtr)
 	cmd = FindMethod(methodName, obj->nsPtr);
@@ -5779,6 +5786,7 @@
     Tcl_Command_deleteProc(cmd) = 0;
 
   if (obj->nsPtr) {
+    /*fprintf(stderr,"primitive odestroy calls deletenamespace for obj %p\n",obj);*/
     XOTcl_DeleteNamespace(in, obj->nsPtr);
     obj->nsPtr = 0;
   }
@@ -6033,7 +6041,9 @@
   /*
    * call and latch user destroy with obj->id if we haven't
    */
+  /*fprintf(stderr,"PrimitiveCDestroy %s flags %x\n",ObjStr(obj->cmdName),obj->flags);*/
   if (!(obj->flags & XOTCL_DESTROY_CALLED))
+    /*fprintf(stderr,"PrimitiveCDestroy call destroy\n");*/
     callDestroyMethod(cd, in, obj, 0);
 
   obj->teardown = 0;
@@ -6050,8 +6060,11 @@
   /*
    * class object destroy + physical destroy
    */
+  /*fprintf(stderr,"primitive cdestroy calls primitive odestroy\n");*/
   PrimitiveODestroy(cd);
 
+  /*fprintf(stderr,"primitive cdestroy calls deletenamespace for obj %p\n",cl);*/
+  saved->clientData = 0;
   XOTcl_DeleteNamespace(in, saved);
 
   return;
Index: xotcl/generic/xotcl.h
===================================================================
diff -u -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 -r55c33d4f309c661c404d79a77168110864e7258a
--- xotcl/generic/xotcl.h	(.../xotcl.h)	(revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4)
+++ xotcl/generic/xotcl.h	(.../xotcl.h)	(revision 55c33d4f309c661c404d79a77168110864e7258a)
@@ -1,6 +1,6 @@
 /* -*- Mode: c++ -*-
  *
- *  $Id: xotcl.h,v 1.5 2004/11/14 01:07:17 neumann Exp $
+ *  $Id: xotcl.h,v 1.6 2004/11/14 17:36:36 neumann Exp $
  *  
  *  Extended Object Tcl (XOTcl)
  *
@@ -52,8 +52,8 @@
 /* activate/deacticate assert 
 #define NDEBUG 1
 */
-#define NDEBUG 1
 
+
 /* activate/deacticate memory tracing 
 #define XOTCL_MEM_TRACE 1
 #define XOTCL_MEM_COUNT 1