kernel/eka/compsupp/symaehabi/callfirstprocessfn.cpp
changeset 266 0008ccd16016
parent 0 a41df078684a
--- a/kernel/eka/compsupp/symaehabi/callfirstprocessfn.cpp	Thu Sep 02 21:54:16 2010 +0300
+++ b/kernel/eka/compsupp/symaehabi/callfirstprocessfn.cpp	Fri Sep 17 08:37:04 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "ARM EABI LICENCE.txt"
@@ -39,14 +39,18 @@
 	{
 	TCppRTExceptionsGlobals aExceptionGlobals;
 
+	#if ENABLE_2ND_EMERGENCY_BUFFER
+	aExceptionGlobals.Init2ndEmergencyBuffer();
+	#endif
+
 	if (!aNotFirst)
 		{
 		// Init statics for implicitly linked DLLs
 		User::InitProcess();
 
-		// Init statics for EXE
 		//pick up export table if we're an exexp
 		__DLL_Export_Table__();
+		// Init statics for EXE
 		__cpp_initialize__aeabi_();
 		}
 #ifdef __LEAVE_EQUALS_THROW__
@@ -54,9 +58,15 @@
 
 	try {
 		r = aNotFirst ? (*aFn)(aPtr) : E32Main();
+        #if ENABLE_2ND_EMERGENCY_BUFFER
+        aExceptionGlobals.Kill2ndEmergencyBuffer();
+        #endif
 		}
 	catch (XLeaveException&)
 		{
+        #if ENABLE_2ND_EMERGENCY_BUFFER
+        aExceptionGlobals.Kill2ndEmergencyBuffer();
+        #endif
 		User::Panic(KLitUser, EUserLeaveWithoutTrap);
 		}