Skip to content

Commit

Permalink
Fix #2615, Tracking return code and logging on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tvisha Andharia committed Dec 2, 2024
1 parent e78f46f commit da3ad9c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/es/fsw/src/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ int32 CFE_ES_StartAppTask(CFE_ES_TaskId_t *TaskIdPtr, const char *TaskName, CFE_
int32 CFE_ES_AppCreate(CFE_ES_AppId_t *ApplicationIdPtr, const char *AppName, const CFE_ES_AppStartParams_t *Params)
{
CFE_Status_t Status;
CFE_Status_t CleanupStatus;
CFE_ES_AppRecord_t *AppRecPtr;
CFE_ResourceId_t PendingResourceId = CFE_RESOURCEID_UNDEFINED;

Expand Down Expand Up @@ -799,8 +800,15 @@ int32 CFE_ES_AppCreate(CFE_ES_AppId_t *ApplicationIdPtr, const char *AppName, co
/*
* Set the table entry back to free
*/
if (OS_ObjectIdDefined(AppRecPtr->LoadStatus.ModuleId)) {
OS_ModuleUnload(AppRecPtr->LoadStatus.ModuleId);
if (OS_ObjectIdDefined(AppRecPtr->LoadStatus.ModuleId))
{
CleanupStatus = OS_ModuleUnload(AppRecPtr->LoadStatus.ModuleId);
if (CleanupStatus != OS_SUCCESS)
{
CFE_ES_WriteToSysLog("%s: Module (ID:0x%08lX) Unload failed. RC=%ld\n", __func__,
OS_ObjectIdToInteger(AppRecPtr->LoadStatus.ModuleId), (long)CleanupStatus);
Status = CFE_ES_APP_CLEANUP_ERR;
}
}

CFE_ES_AppRecordSetFree(AppRecPtr);
Expand Down

0 comments on commit da3ad9c

Please sign in to comment.