Skip to content

Commit

Permalink
Clean up some potential memory leaks
Browse files Browse the repository at this point in the history
The watchdog tasks are allocated, but not consistently removed. In
general this doesn't matter: they run in threads that will only
end when the process actually quits. For consistency and for the
purpose of future-proofing, I think there is value in having the
cleanup added in each case.
  • Loading branch information
simon-ess authored and anjohnson committed May 15, 2024
1 parent 4bb50fe commit 839f764
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/database/src/ioc/as/asCa.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ static void asCaTask(void)
if(asCaDebug) printf("asCaTask has cleared all channels\n");
epicsEventSignal(asCaTaskWait);
}

/* ATM never reached, just a placeholder */
cantProceed("Unreachable. Perpetual thread.");

taskwdRemove(0);
}

void asCaStart(void)
Expand Down
5 changes: 5 additions & 0 deletions modules/database/src/ioc/rsrv/caservertask.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ static void req_server (void *pParm)
}
}
}

/* ATM never reached, just a placeholder */
cantProceed("Unreachable. Perpetual thread.");

taskwdRemove(0);
}

static
Expand Down
4 changes: 4 additions & 0 deletions modules/database/src/ioc/rsrv/online_notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ void rsrv_online_notify_task(void *pParm)
}
}

/* ATM never reached, just a placeholder */
cantProceed("Unreachable. Perpetual thread.");

free(lastError);
taskwdRemove(0);
}


0 comments on commit 839f764

Please sign in to comment.