Skip to content

Commit

Permalink
Merge pull request #711 from jphickey/fix-471-deleteall-order
Browse files Browse the repository at this point in the history
Fix #471, order of operations for delete all
  • Loading branch information
astrogeco authored Jan 12, 2021
2 parents 3fcac5f + b5863b7 commit 35795ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/os/shared/src/osapi-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,18 @@ void OS_DeleteAllObjects(void)
{
ObjectCount = 0;
++TryCount;

/* Delete timers and tasks first, as they could be actively using other object types */
OS_ForEachObjectOfType(OS_OBJECT_TYPE_OS_TIMECB, OS_OBJECT_CREATOR_ANY,
OS_CleanUpObject, &ObjectCount);
OS_ForEachObjectOfType(OS_OBJECT_TYPE_OS_TIMEBASE, OS_OBJECT_CREATOR_ANY,
OS_CleanUpObject, &ObjectCount);
OS_ForEachObjectOfType(OS_OBJECT_TYPE_OS_TASK, OS_OBJECT_CREATOR_ANY,
OS_CleanUpObject, &ObjectCount);

/* Then try to delete all other remaining objects of any type */
OS_ForEachObject(OS_OBJECT_CREATOR_ANY, OS_CleanUpObject, &ObjectCount);

if (ObjectCount == 0 || TryCount > 4)
{
break;
Expand Down

0 comments on commit 35795ca

Please sign in to comment.