SICS-632 Allocate a copy of the connection, for motor tracing, and free it at the end.

This commit is contained in:
Douglas Clowes
2013-07-01 17:06:49 +10:00
parent a44cd3464d
commit 7c0dfe437a

View File

@@ -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;