[mapguide-commits] r4951 - trunk/MgDev/Common/MapGuideCommon/System
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Jun 17 12:35:31 EDT 2010
Author: brucedechant
Date: 2010-06-17 16:35:31 +0000 (Thu, 17 Jun 2010)
New Revision: 4951
Modified:
trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
Log:
Fix for trac ticket #1110 - Stability improvements
Notes:
- Updated SetCurrentUserInfo to use SAFE_ADDREF/SAFE_RELEASE due to double free memory error on Linux
This is what the error looked like and it would cause the server to crash on Linux:
*** glibc detected *** ./mgserver: double free or corruption (fasttop): 0xa784f928 ***
Modified: trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp 2010-06-17 16:29:33 UTC (rev 4950)
+++ trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp 2010-06-17 16:35:31 UTC (rev 4951)
@@ -377,20 +377,13 @@
if (0 != g_threadLocalUserInformation)
{
+ // Clean up old one if applicable
MgUserInformation* oldInfo = NULL;
ACE_OS::thr_getspecific(g_threadLocalUserInformation, (void**) &oldInfo);
-
- // Allocate a new MgUserInformation
- MgUserInformation* tempUserInformation = NULL;
- if(userInformation != NULL)
- {
- tempUserInformation = new MgUserInformation(*userInformation);
- }
-
- ACE_OS::thr_setspecific(g_threadLocalUserInformation, tempUserInformation);
-
- // Clean up old one if applicable
SAFE_RELEASE(oldInfo);
+
+ SAFE_ADDREF(userInformation);
+ ACE_OS::thr_setspecific(g_threadLocalUserInformation, userInformation);
}
}
More information about the mapguide-commits
mailing list