From 93e745ef8356367029c8546cd402df124fdfe7f2 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 16 Aug 2001 01:19:52 +0000 Subject: [PATCH] supress channel destroy exception in "old" API layer --- src/ca/getCallback.cpp | 18 ++++++++++-------- src/ca/getCopy.cpp | 7 +++++-- src/ca/putCallback.cpp | 19 ++++++++++--------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/ca/getCallback.cpp b/src/ca/getCallback.cpp index 28ed04c43..cfc8cacd8 100644 --- a/src/ca/getCallback.cpp +++ b/src/ca/getCallback.cpp @@ -49,14 +49,16 @@ void getCallback::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 ) { + 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 ); + } delete this; } diff --git a/src/ca/getCopy.cpp b/src/ca/getCopy.cpp index d4db3499f..02afd63db 100644 --- a/src/ca/getCopy.cpp +++ b/src/ca/getCopy.cpp @@ -64,8 +64,11 @@ void getCopy::completion ( unsigned typeIn, void getCopy::exception ( int status, const char *pContext, unsigned /* typeIn */, arrayElementCount /* countIn */ ) { - this->cacCtx.exception ( status, pContext, - __FILE__, __LINE__, this->chan, this->type, this->count, CA_OP_GET ); + if ( status != ECA_CHANDESTROY ) { + this->cacCtx.exception ( status, pContext, + __FILE__, __LINE__, this->chan, this->type, + this->count, CA_OP_GET ); + } delete this; } diff --git a/src/ca/putCallback.cpp b/src/ca/putCallback.cpp index 21f71fccb..a3f3a6ad3 100644 --- a/src/ca/putCallback.cpp +++ b/src/ca/putCallback.cpp @@ -49,15 +49,16 @@ void putCallback::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 ) { + 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); + } delete this; }