[mapguide-commits] r4930 -
sandbox/adsk/2.1/Common/MapGuideCommon/System
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu May 27 15:11:25 EDT 2010
Author: brucedechant
Date: 2010-05-27 15:11:24 -0400 (Thu, 27 May 2010)
New Revision: 4930
Modified:
sandbox/adsk/2.1/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: sandbox/adsk/2.1/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- sandbox/adsk/2.1/Common/MapGuideCommon/System/UserInformation.cpp 2010-05-27 05:01:19 UTC (rev 4929)
+++ sandbox/adsk/2.1/Common/MapGuideCommon/System/UserInformation.cpp 2010-05-27 19:11:24 UTC (rev 4930)
@@ -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