Index: RTPInterface.cpp
===================================================================
--- RTPInterface.cpp	(revision 3095)
+++ RTPInterface.cpp	(working copy)
@@ -172,6 +172,7 @@
        streamsPtr = &((*streamsPtr)->fNext)) {
     if ((*streamsPtr)->fStreamSocketNum == sockNum
 	&& (*streamsPtr)->fStreamChannelId == streamChannelId) {
+      fReadHandlerProc = NULL; // Do not allow any more tcpReadHandler calls into us.
       deregisterSocket(envir(), sockNum, streamChannelId);
 
       // Then remove the record pointed to by *streamsPtr :
@@ -279,6 +280,7 @@
   // Also turn off read handling on each of our TCP connections:
   for (tcpStreamRecord* streams = fTCPStreams; streams != NULL;
        streams = streams->fNext) {
+    fReadHandlerProc = NULL; // Do not allow any more tcpReadHandler calls into us.
     deregisterSocket(envir(), streams->fStreamSocketNum, streams->fStreamChannelId);
   }
 }
@@ -373,6 +375,8 @@
     // Then remove the hash table entries themselves, and then remove the hash table:
     while (fSubChannelHashTable->RemoveNext() != NULL) {}
     delete fSubChannelHashTable;
+
+    delete iter;
   }
 }
 
@@ -409,7 +413,7 @@
 
   if (fSubChannelHashTable->IsEmpty()) {
     // No more interfaces are using us, so it's curtains for us now:
-    fDeleteMyselfNext = True; // hack to cause ourself to be deleted from "tcpReadHandler()" below
+    delete this;
   }
 }
 
