From 217cc108403799e1e9981e5a891a4ee2db772ac0 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 16 Aug 2001 01:18:05 +0000 Subject: [PATCH] supress channel destroy exception in "old" API layer and reclaim storage for oldSubscription when channel is destroyed --- src/ca/oldSubscription.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ca/oldSubscription.cpp b/src/ca/oldSubscription.cpp index 771b5e23f..e5e26d1a9 100644 --- a/src/ca/oldSubscription.cpp +++ b/src/ca/oldSubscription.cpp @@ -39,14 +39,18 @@ void oldSubscription::exception ( int status, const char * /* pContext */, unsigned type, arrayElementCount count ) { - struct event_handler_args args; - - args.usr = this->pPrivate; - args.chid = &this->chan; - args.type = type; - args.count = count; - args.status = status; - args.dbr = 0; - ( *this->pFunc ) ( args ); + if ( status == ECA_CHANDESTROY ) { + delete this; + } + else if ( status != ECA_DISCONN ) { + struct event_handler_args args; + args.usr = this->pPrivate; + args.chid = &this->chan; + args.type = type; + args.count = count; + args.status = status; + args.dbr = 0; + ( *this->pFunc ) ( args ); + } }