[mapguide-commits] r4956 - sandbox/adsk/2.2gp/Common/MapGuideCommon/System

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jun 17 13:36:15 EDT 2010


Author: brucedechant
Date: 2010-06-17 17:36:15 +0000 (Thu, 17 Jun 2010)
New Revision: 4956

Modified:
   sandbox/adsk/2.2gp/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.2gp/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/MapGuideCommon/System/UserInformation.cpp	2010-06-17 17:34:22 UTC (rev 4955)
+++ sandbox/adsk/2.2gp/Common/MapGuideCommon/System/UserInformation.cpp	2010-06-17 17:36:15 UTC (rev 4956)
@@ -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