diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com.c XBlast-TNT.modify/com.c
--- XBlast-TNT.orig/com.c	2001-07-01 18:16:38.000000000 +0200
+++ XBlast-TNT.modify/com.c	2002-06-05 22:15:33.000000000 +0200
@@ -38,7 +38,7 @@
     case XCR_Finished:
     case XCR_Error:
       assert (NULL != comm->deleteFunc);
-      (void) (*comm->deleteFunc) (comm);
+      (void) (*comm->deleteFunc) (comm,0);
       break;
     default:
       break;
@@ -59,7 +59,7 @@
     case XCR_Finished:
     case XCR_Error:
       assert (NULL != comm->deleteFunc);
-      (void) (*comm->deleteFunc) (comm);
+      (void) (*comm->deleteFunc) (comm,0);
       break;
     default:
       break;
@@ -75,7 +75,7 @@
 {
   assert (NULL != comm);
   assert (NULL != comm->deleteFunc);
-  (void) (*comm->deleteFunc) (comm);
+  (void) (*comm->deleteFunc) (comm,1);
 } /* CommDelete */
 
 /*
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_base.c XBlast-TNT.modify/com_base.c
--- XBlast-TNT.orig/com_base.c	2001-04-01 12:07:55.000000000 +0200
+++ XBlast-TNT.modify/com_base.c	2002-06-05 22:26:03.000000000 +0200
@@ -32,7 +32,7 @@
  */
 void
 CommInit (XBComm *comm, XBCommType type, XBSocket *socket, XBCommFunc readFunc, XBCommFunc writeFunc, 
-	  XBCommFunc deleteFunc)
+	  XBCommDelFunc deleteFunc)
 {
   /* sanity checks */
   assert (NULL != comm);
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_base.h XBlast-TNT.modify/com_base.h
--- XBlast-TNT.orig/com_base.h	2001-06-04 23:03:36.000000000 +0200
+++ XBlast-TNT.modify/com_base.h	2002-06-05 22:20:10.000000000 +0200
@@ -52,6 +52,7 @@
 
 /* process functions */
 typedef XBCommResult (*XBCommFunc) (XBComm *);
+typedef XBCommResult (*XBCommDelFunc) (XBComm *, int );
 
 /* generic data of communication */
 struct _xb_comm {
@@ -61,14 +62,14 @@
   XBSocket   *socket;
   XBCommFunc  readFunc;
   XBCommFunc  writeFunc;
-  XBCommFunc  deleteFunc;
+  XBCommDelFunc  deleteFunc;
 };
 
 /*
  * global prototypes
  */
 extern void      CommInit (XBComm *comm, XBCommType type, XBSocket *socket, XBCommFunc readFunc, XBCommFunc writeFunc, 
-			   XBCommFunc deleteFunc);
+			   XBCommDelFunc deleteFunc);
 extern void      CommFinish (XBComm *comm);
 extern XBSocket *CommSocket (XBComm *comm);
 extern XBComm   *CommFind (int fd);
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_browse.c XBlast-TNT.modify/com_browse.c
--- XBlast-TNT.orig/com_browse.c	2001-06-04 23:01:15.000000000 +0200
+++ XBlast-TNT.modify/com_browse.c	2002-06-05 22:21:03.000000000 +0200
@@ -141,7 +141,7 @@
  * intialize data structure
  */
 XBComm *
-Browse_CommInit (XBCommBrowse *bComm, XBCommType commType, XBSocket *pSocket, BrowseReceiveFunc receiveFunc, XBCommFunc deleteFunc)
+Browse_CommInit (XBCommBrowse *bComm, XBCommType commType, XBSocket *pSocket, BrowseReceiveFunc receiveFunc, XBCommDelFunc deleteFunc)
 {
   assert (NULL != bComm);
   assert (NULL != receiveFunc);
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_browse.h XBlast-TNT.modify/com_browse.h
--- XBlast-TNT.orig/com_browse.h	2001-06-04 23:02:36.000000000 +0200
+++ XBlast-TNT.modify/com_browse.h	2002-06-05 22:23:17.000000000 +0200
@@ -45,7 +45,7 @@
 /*
  * global prototypes
  */
-extern XBComm *Browse_CommInit (XBCommBrowse *, XBCommType, XBSocket *, BrowseReceiveFunc, XBCommFunc);
+extern XBComm *Browse_CommInit (XBCommBrowse *, XBCommType, XBSocket *, BrowseReceiveFunc, XBCommDelFunc);
 extern void Browse_Send (XBCommBrowse *bComm, const char *hostname, unsigned port, XBBool broadcast, const XBBrowseTeleAny *tele);
 extern void Browse_Finish (XBCommBrowse *);
 
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_dgram.c XBlast-TNT.modify/com_dgram.c
--- XBlast-TNT.orig/com_dgram.c	2001-08-16 22:04:10.000000000 +0200
+++ XBlast-TNT.modify/com_dgram.c	2002-06-05 22:43:55.000000000 +0200
@@ -237,7 +237,7 @@
  *
  */
 static XBCommResult
-DeleteDgram (XBComm *comm)
+DeleteDgram (XBComm *comm, int free_struct)
 {
   XBCommDgram *dgram = (XBCommDgram *) comm;
 
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_listen.c XBlast-TNT.modify/com_listen.c
--- XBlast-TNT.orig/com_listen.c	2000-08-27 14:24:32.000000000 +0200
+++ XBlast-TNT.modify/com_listen.c	2002-06-05 22:43:11.000000000 +0200
@@ -58,7 +58,7 @@
  *
  */
 static XBCommResult
-DeleteListen (XBComm *comm)
+DeleteListen (XBComm *comm, int free_struct)
 {
   CommFinish (comm);
   free (comm);
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_query.c XBlast-TNT.modify/com_query.c
--- XBlast-TNT.orig/com_query.c	2001-06-16 15:37:00.000000000 +0200
+++ XBlast-TNT.modify/com_query.c	2002-06-05 22:34:03.000000000 +0200
@@ -96,16 +96,21 @@
  *
  */
 static XBCommResult 
-DeleteQuery (XBComm *comm)
+DeleteQuery (XBComm *comm, int free_struct)
 {
   XBCommQuery *qComm = (XBCommQuery *) comm;
   /* */
   assert (NULL != qComm);
-  Browse_Finish (&qComm->browse);
-  assert (NULL != qComm->addrBroadcast);
-  free (qComm->addrBroadcast);
-  free (qComm);
-  qComm = NULL;
+  if (qComm->port) {
+    Browse_Finish (&qComm->browse);
+    qComm->port=0;
+  }
+  if (free_struct) {
+     assert (NULL != qComm->addrBroadcast);
+     free (qComm->addrBroadcast);
+     free (qComm);
+     qComm = NULL;
+  }
   return XCR_OK;
 } /* DeleteQuery  */
 
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_reply.c XBlast-TNT.modify/com_reply.c
--- XBlast-TNT.orig/com_reply.c	2001-06-14 13:35:48.000000000 +0200
+++ XBlast-TNT.modify/com_reply.c	2002-06-05 22:18:43.000000000 +0200
@@ -83,14 +83,16 @@
  *
  */
 static XBCommResult 
-DeleteReply (XBComm *comm)
+DeleteReply (XBComm *comm, int free_struct)
 {
   XBCommReply *rComm = (XBCommReply *) comm;
   /* */
   assert (NULL != rComm);
   Browse_Finish (&rComm->browse);
-  free (rComm);
-  rComm = NULL;
+  if (free_struct) {
+     free (rComm);
+     rComm = NULL;
+  }
   return XCR_OK;
 } /* DeleteReply  */
 
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_stream.c XBlast-TNT.modify/com_stream.c
--- XBlast-TNT.orig/com_stream.c	2001-07-01 19:07:47.000000000 +0200
+++ XBlast-TNT.modify/com_stream.c	2002-06-05 22:44:18.000000000 +0200
@@ -106,7 +106,7 @@
  */
 void
 Stream_CommInit (XBCommStream *stream, XBCommType commType, XBSocket *pSocket, HandleFunc handleFunc, 
-		 ErrorFunc errorFunc, XBCommFunc deleteFunc)
+		 ErrorFunc errorFunc, XBCommDelFunc deleteFunc)
 {
   assert (stream != NULL);
   /* set values */
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_stream.h XBlast-TNT.modify/com_stream.h
--- XBlast-TNT.orig/com_stream.h	2001-06-27 08:02:09.000000000 +0200
+++ XBlast-TNT.modify/com_stream.h	2002-06-05 22:44:38.000000000 +0200
@@ -49,7 +49,7 @@
 /*
  * global prototypes
  */
-extern void Stream_CommInit (XBCommStream *, XBCommType, XBSocket *, HandleFunc, ErrorFunc, XBCommFunc);
+extern void Stream_CommInit (XBCommStream *, XBCommType, XBSocket *, HandleFunc, ErrorFunc, XBCommDelFunc);
 extern void Stream_CommFinish (XBCommStream *stream);
 
 #endif
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_to_client.c XBlast-TNT.modify/com_to_client.c
--- XBlast-TNT.orig/com_to_client.c	2001-08-16 22:05:27.000000000 +0200
+++ XBlast-TNT.modify/com_to_client.c	2002-06-05 22:50:18.000000000 +0200
@@ -158,7 +158,7 @@
  *
  */
 static XBCommResult
-DeleteToClient (XBComm *comm)
+DeleteToClient (XBComm *comm, int free_struct)
 {
   XBCommToClient *toClient = (XBCommToClient *) comm;
 
diff -Naur --exclude=level --exclude=image --exclude=Makefile --exclude='*.raw' XBlast-TNT.orig/com_to_server.c XBlast-TNT.modify/com_to_server.c
--- XBlast-TNT.orig/com_to_server.c	2001-08-16 22:05:34.000000000 +0200
+++ XBlast-TNT.modify/com_to_server.c	2002-06-05 22:50:44.000000000 +0200
@@ -257,7 +257,7 @@
  *
  */
 static XBCommResult 
-DeleteToServer (XBComm *comm)
+DeleteToServer (XBComm *comm, int free_struct)
 {
   /* delete communication */
   Stream_CommFinish ((XBCommStream *) comm);

