SICS-632 Allocate a copy of the connection, for motor tracing, and free it at the end.
This commit is contained in:
@@ -4374,11 +4374,14 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
}
|
||||
else if(strcasecmp("trace", argv[1]) == 0) {
|
||||
if (argc > 2 && strcasecmp("on", argv[2]) == 0) {
|
||||
self->trace = pCon;
|
||||
self->trace = SCCopyConnection(pCon);
|
||||
SCWrite(pCon, "TRACE ON", eValue);
|
||||
}
|
||||
else {
|
||||
self->trace = 0;
|
||||
if (self->trace) {
|
||||
SCDeleteConnection(self->trace);
|
||||
self->trace = 0;
|
||||
}
|
||||
SCWrite(pCon, "TRACE OFF", eValue);
|
||||
}
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user