Skip to content

Commit

Permalink
Check socket is valid before destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd committed Feb 1, 2024
1 parent 88665ce commit 8b04a4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/castApp/src/caster.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ void casterShutdown(caster_t *self)

epicsEventDestroy(self->shutdownEvent);
self->shutdownEvent = NULL;
epicsSocketDestroy(self->wakeup[0]);
epicsSocketDestroy(self->wakeup[1]);

if (self->wakeup[0] != INVALID_SOCKET) {
epicsSocketDestroy(self->wakeup[0]);
}
if (self->wakeup[1] != INVALID_SOCKET) {
epicsSocketDestroy(self->wakeup[1]);
}
epicsMutexDestroy(self->lock);
}

Expand Down

0 comments on commit 8b04a4d

Please sign in to comment.