Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unloading module after failed app start #2616

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 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,6 +800,16 @@ 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))
{
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);
}
}

CFE_ES_AppRecordSetFree(AppRecPtr);
PendingResourceId = CFE_RESOURCEID_UNDEFINED;
}
Expand Down
Loading