ShellPkg: Unregister hotkey callback when exiting Shell

Commit 9168df3dea
"ShellPkg/ShellProtocol.c: Handle memory allocation failure"
only keeps the protocol clean up in CleanUpShellProtocol() and
creates a new function CleanUpShellEnvironment() which calls
CleanUpShellProtocol(), then unregisters the hotkey callback.

But the commit forgot to change the Shell.c to call
CleanUpShellEnvironment() which causes the hotkey callback is
not unregistered while the callback function doesn't exist
when Shell exits.

This causes system hang when pressing CTRL+C after exiting shell.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
Ruiyu Ni 2016-07-28 12:46:25 +08:00
parent 9b7143c904
commit 031403460c
1 changed files with 1 additions and 1 deletions

View File

@ -667,7 +667,7 @@ FreeResources:
if (ShellInfoObject.NewEfiShellProtocol->IsRootShell()){
InternalEfiShellSetEnv(L"cwd", NULL, TRUE);
}
CleanUpShellProtocol(ShellInfoObject.NewEfiShellProtocol);
CleanUpShellEnvironment (ShellInfoObject.NewEfiShellProtocol);
DEBUG_CODE(ShellInfoObject.NewEfiShellProtocol = NULL;);
}