]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg DxeCore: Call UnregisterMemoryProfileImage correctly.
authorStar Zeng <star.zeng@intel.com>
Tue, 9 Jun 2015 09:41:02 +0000 (09:41 +0000)
committerlzeng14 <lzeng14@Edk2>
Tue, 9 Jun 2015 09:41:02 +0000 (09:41 +0000)
Use if (Image->Started) condition judgement before call to
UnregisterMemoryProfileImage() in CoreUnloadAndCloseImage().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17597 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Image/Image.c

index 33686a66c4c168c551dff7ecfb405e54106f7f28..ea6b2c6a4268e4e8c40a03b398ea1eadeb778e74 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Core image handling services to load and unload PeImage.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -858,6 +858,10 @@ CoreUnloadAndCloseImage (
   HandleBuffer = NULL;\r
   ProtocolGuidArray = NULL;\r
 \r
+  if (Image->Started) {\r
+    UnregisterMemoryProfileImage (Image);\r
+  }\r
+\r
   if (Image->Ebc != NULL) {\r
     //\r
     // If EBC protocol exists we must perform cleanups for this image.\r
@@ -1854,7 +1858,6 @@ CoreUnloadImage (
     Status = EFI_INVALID_PARAMETER;\r
     goto Done;\r
   }\r
-  UnregisterMemoryProfileImage (Image);\r
 \r
   if (Image->Started) {\r
     //\r