summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c
index a5bf876e25..b3e9bdd9be 100644
--- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c
+++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c
@@ -578,22 +578,29 @@ RemovePackNotify (
ThunkContext = UefiHiiHandleToThunkContext (Private, Handle);
- if (!ThunkContext->ByFrameworkHiiNewPack) {
- Status = HiiLibExportPackageLists (Handle, &HiiPackageList, &BufferSize);
- ASSERT_EFI_ERROR (Status);
+ //
+ // BugBug: Change to ASSERT if HII Database fix the bug and to also invoke
+ // NEW_PACK_NOTIFY for package (String Package) created internally.
+ //
+ if (ThunkContext != NULL) {
+ if (!ThunkContext->ByFrameworkHiiNewPack) {
+ Status = HiiLibExportPackageLists (Handle, &HiiPackageList, &BufferSize);
+ ASSERT_EFI_ERROR (Status);
- if (GetPackageCountByType (HiiPackageList, EFI_HII_PACKAGE_STRINGS) == 1) {
- //
- // If the string package will be removed is the last string package
- // in the package list, we will remove the HII Thunk entry from the
- // database.
- //
- DestroyThunkContextForUefiHiiHandle (Private, Handle);
- }
+ if (GetPackageCountByType (HiiPackageList, EFI_HII_PACKAGE_STRINGS) == 1) {
+ //
+ // If the string package will be removed is the last string package
+ // in the package list, we will remove the HII Thunk entry from the
+ // database.
+ //
+ DestroyThunkContextForUefiHiiHandle (Private, Handle);
+ }
- FreePool (HiiPackageList);
+ FreePool (HiiPackageList);
+ }
}
+
return Status;
}