Bug 557922, Backed out changeset 12f5162b65c9
authorKai Engert <kaie@kuix.de>
Wed, 25 Jul 2018 14:13:08 +0200
changeset 4790 9510317eda5bb4cf8c936e6c548f47d5b58f0054
parent 4789 12f5162b65c96576f548a8e51fa23717f0493feb
child 4791 6e31156d700294ba50ab7bd5d761a480f7663581
push id298
push userkaie@kuix.de
push dateWed, 25 Jul 2018 12:12:17 +0000
bugs557922
Bug 557922, Backed out changeset 12f5162b65c9
pr/include/private/primpl.h
pr/src/linking/prlink.c
pr/src/misc/prerrortable.c
pr/src/misc/prinit.c
pr/src/pthreads/ptthread.c
pr/src/threads/prtpd.c
--- a/pr/include/private/primpl.h
+++ b/pr/include/private/primpl.h
@@ -1797,17 +1797,16 @@ extern void _PR_InitNet(void);
 extern void _PR_InitClock(void);
 extern void _PR_InitLinker(void);
 extern void _PR_InitAtomic(void);
 extern void _PR_InitCPUs(void);
 extern void _PR_InitDtoa(void);
 extern void _PR_InitTime(void);
 extern void _PR_InitMW(void);
 extern void _PR_InitRWLocks(void);
-extern void _PR_CleanupErrorTables();
 extern void _PR_CleanupThread(PRThread *thread);
 extern void _PR_CleanupCallOnce(void);
 extern void _PR_CleanupMW(void);
 extern void _PR_CleanupTime(void);
 extern void _PR_CleanupDtoa(void);
 extern void _PR_ShutdownLinker(void);
 extern void _PR_CleanupEnv(void);
 extern void _PR_CleanupIO(void);
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -211,26 +211,25 @@ void _PR_InitLinker(void)
  * _PR_ShutdownLinker does not unload the dlls loaded by the application
  * via calls to PR_LoadLibrary.  Any dlls that still remain on the
  * pr_loadmap list when NSPR shuts down are application programming errors.
  * The only exception is pr_exe_loadmap, which was added to the list by
  * NSPR and hence should be cleaned up by NSPR.
  */
 void _PR_ShutdownLinker(void)
 {
+    /* FIXME: pr_exe_loadmap should be destroyed. */
+    
     PR_DestroyMonitor(pr_linker_lock);
     pr_linker_lock = NULL;
 
     if (_pr_currentLibPath) {
         free(_pr_currentLibPath);
         _pr_currentLibPath = NULL;
     }
-
-    free(pr_exe_loadmap->name);
-    PR_FREEIF(pr_exe_loadmap);
 }
 
 /******************************************************************************/
 
 PR_IMPLEMENT(PRStatus) PR_SetLibraryPath(const char *path)
 {
     PRStatus rv = PR_SUCCESS;
 
--- a/pr/src/misc/prerrortable.c
+++ b/pr/src/misc/prerrortable.c
@@ -176,36 +176,16 @@ PR_ErrorInstallTable(const struct PRErro
     } else {
 	new_et->table_private = 0;
     }
     new_et->next = Table_List;
     Table_List = new_et;
     return 0;
 }
 
-void
-_PR_CleanupErrorTables()
-{
-    struct PRErrorTableList *et;
-
-    et = Table_List;
-
-    while (et) {
-        struct PRErrorTableList *next_et;
-
-        next_et = et->next;
-
-        PR_FREEIF(et);
-
-        et = next_et;
-    }
-
-    Table_List = NULL;
-}
-
 PR_IMPLEMENT(void)
 PR_ErrorInstallCallback(const char * const * languages,
 		       PRErrorCallbackLookupFn *lookup, 
 		       PRErrorCallbackNewTableFn *newtable,
 		       struct PRErrorCallbackPrivate *cb_private)
 {
     struct PRErrorTableList *et;
 
--- a/pr/src/misc/prinit.c
+++ b/pr/src/misc/prinit.c
@@ -374,18 +374,16 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup()
 		/*
 		 * The primordial thread must now be running on the primordial cpu
 		 */
     	PR_ASSERT((_PR_IS_NATIVE_THREAD(me)) || (me->cpu->id == 0));
 #endif
 
         _PR_MD_EARLY_CLEANUP();
 
-        _PR_CleanupErrorTables();
-
         _PR_CleanupMW();
         _PR_CleanupTime();
         _PR_CleanupDtoa();
         _PR_CleanupCallOnce();
 		_PR_ShutdownLinker();
         _PR_CleanupNet();
         _PR_CleanupIO();
         /* Release the primordial thread's private data, etc. */
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -1090,18 +1090,16 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
         if (me->state & PT_THREAD_SYSTEM)
             pt_book.system -= 1;
         else
             pt_book.user -= 1;
         PR_Unlock(pt_book.ml);
 
         _PR_MD_EARLY_CLEANUP();
 
-        _PR_CleanupErrorTables();
-
         _PR_CleanupMW();
         _PR_CleanupTime();
         _PR_CleanupDtoa();
         _PR_CleanupCallOnce();
         _PR_ShutdownLinker();
         _PR_LogCleanup();
         _PR_CleanupNet();
         /* Close all the fd's before calling _PR_CleanupIO */
@@ -1124,17 +1122,16 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
         }
         PR_DestroyLock(_pr_sleeplock);
         _pr_sleeplock = NULL;
         _PR_CleanupLayerCache();
         _PR_CleanupEnv();
 #ifdef _PR_ZONE_ALLOCATOR
         _PR_DestroyZones();
 #endif
-        _PR_CleanupTPD();
         _pr_initialized = PR_FALSE;
         return PR_SUCCESS;
     }
     return PR_FAILURE;
 }  /* PR_Cleanup */
 
 PR_IMPLEMENT(void) PR_ProcessExit(PRIntn status)
 {
--- a/pr/src/threads/prtpd.c
+++ b/pr/src/threads/prtpd.c
@@ -67,20 +67,16 @@ void _PR_InitTPD(void)
     _pr_tpd_length = _PR_TPD_LIMIT;
 }
 
 /*
 ** Clean up the thread private data manipulation
 */
 void _PR_CleanupTPD(void)
 {
-    _pr_tpd_length = 0;
-    _pr_tpd_highwater = 0;
-    PR_FREEIF(_pr_tpd_destructors);
-    _pr_tpd_destructors = NULL;
 }  /* _PR_CleanupTPD */
 
 /*
 ** This routine returns a new index for per-thread-private data table. 
 ** The index is visible to all threads within a process. This index can 
 ** be used with the PR_SetThreadPrivate() and PR_GetThreadPrivate() routines 
 ** to save and retrieve data associated with the index for a thread.
 **