From 8b0161c46373a45e68322ab63f73c7bcb56740b3 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 25 Sep 2001 00:09:26 +0000 Subject: [PATCH] added comment --- src/ca/access.cpp | 2 ++ src/ca/oldAccess.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ca/access.cpp b/src/ca/access.cpp index aa8299c38..389c77d2d 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -588,6 +588,8 @@ extern "C" int epicsShareAPI ca_add_masked_array_event ( *monixptr = pTmp; } pTmp->begin ( tmpType, count, mask ); + // dont touch pTmp after this because + // the first callback might have canceled it return ECA_NORMAL; } else { diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index 1420a7300..87408d3d2 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -350,8 +350,10 @@ inline oldSubscription::oldSubscription ( inline void oldSubscription::begin ( unsigned type, arrayElementCount nElem, unsigned mask ) { - this->chan.subscribe ( type, nElem, mask, *this, this->id ); this->subscribed = true; + this->chan.subscribe ( type, nElem, mask, *this, this->id ); + // dont touch this pointer after this point because the + // 1st update callback might cancel the subscription } inline void oldSubscription::destroy ()