Skip to content

Commit 0d51d94

Browse files
committed
Add port shutdown to NDPluginROI
1 parent d64404a commit 0d51d94

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ADApp/pluginSrc/NDPluginROI.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ asynStatus NDPluginROI::writeInt32(asynUser *pasynUser, epicsInt32 value)
283283
return status;
284284
}
285285

286-
287286
/** Constructor for NDPluginROI; most parameters are simply passed to NDPluginDriver::NDPluginDriver.
288287
* After calling the base class constructor this method sets reasonable default values for all of the
289288
* ROI parameters.
@@ -307,13 +306,13 @@ asynStatus NDPluginROI::writeInt32(asynUser *pasynUser, epicsInt32 value)
307306
NDPluginROI::NDPluginROI(const char *portName, int queueSize, int blockingCallbacks,
308307
const char *NDArrayPort, int NDArrayAddr,
309308
int maxBuffers, size_t maxMemory,
310-
int priority, int stackSize, int maxThreads)
309+
int priority, int stackSize, int maxThreads, int asynFlags)
311310
/* Invoke the base class constructor */
312311
: NDPluginDriver(portName, queueSize, blockingCallbacks,
313312
NDArrayPort, NDArrayAddr, 1, maxBuffers, maxMemory,
314313
asynInt32ArrayMask | asynFloat64ArrayMask | asynGenericPointerMask,
315314
asynInt32ArrayMask | asynFloat64ArrayMask | asynGenericPointerMask,
316-
ASYN_MULTIDEVICE, 1, priority, stackSize, maxThreads)
315+
asynFlags | ASYN_MULTIDEVICE, 1, priority, stackSize, maxThreads)
317316
{
318317
//static const char *functionName = "NDPluginROI";
319318

@@ -360,8 +359,13 @@ extern "C" int NDROIConfigure(const char *portName, int queueSize, int blockingC
360359
int maxBuffers, size_t maxMemory,
361360
int priority, int stackSize, int maxThreads)
362361
{
362+
int flags = 0;
363+
#ifdef ASYN_DESTRUCTIBLE
364+
flags |= ASYN_DESTRUCTIBLE;
365+
#endif
366+
363367
NDPluginROI *pPlugin = new NDPluginROI(portName, queueSize, blockingCallbacks, NDArrayPort, NDArrayAddr,
364-
maxBuffers, maxMemory, priority, stackSize, maxThreads);
368+
maxBuffers, maxMemory, priority, stackSize, maxThreads, flags);
365369
return pPlugin->start();
366370
}
367371

ADApp/pluginSrc/NDPluginROI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class NDPLUGIN_API NDPluginROI : public NDPluginDriver {
4141
NDPluginROI(const char *portName, int queueSize, int blockingCallbacks,
4242
const char *NDArrayPort, int NDArrayAddr,
4343
int maxBuffers, size_t maxMemory,
44-
int priority, int stackSize, int maxThreads);
44+
int priority, int stackSize, int maxThreads, int asynFlags = 0);
4545
/* These methods override the virtual methods in the base class */
4646
void processCallbacks(NDArray *pArray);
4747
asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);

0 commit comments

Comments
 (0)