protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (topicPublisher != null)
                    {
                        RemoveDataWriter();

                        ReturnCode status = topicPublisher.DeleteContainedEntities();
                        ErrorHandler.CheckStatus(status, "TopicPublisher.DeleteContainedEntities (Dispose)");

                        status = currentTopic.Participant.DeletePublisher(topicPublisher);
                        ErrorHandler.CheckStatus(status, "TopicPublisher.DeletePublisher (Dispose)");

                        topicPublisher = null;
                    }
                }
                catch (Exception e)
                {
                }
            }
        }