]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Unregister hotkey callback when exiting Shell
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 28 Jul 2016 04:46:25 +0000 (12:46 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 29 Jul 2016 01:52:40 +0000 (09:52 +0800)
Commit 9168df3dea65f707d1e9c32eba5e18ef6b84e5cd
"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>
ShellPkg/Application/Shell/Shell.c

index 0f1fb9c287b83c253b40e76e979e43782055c95a..3080a1644f6e49ca70fba285b15ab306910c7270 100644 (file)
@@ -667,7 +667,7 @@ FreeResources:
     if (ShellInfoObject.NewEfiShellProtocol->IsRootShell()){\r
       InternalEfiShellSetEnv(L"cwd", NULL, TRUE);\r
     }\r
-    CleanUpShellProtocol(ShellInfoObject.NewEfiShellProtocol);\r
+    CleanUpShellEnvironment (ShellInfoObject.NewEfiShellProtocol);\r
     DEBUG_CODE(ShellInfoObject.NewEfiShellProtocol = NULL;);\r
   }\r
 \r