diff options
author | wtc%netscape.com <devnull@localhost> | 2001-08-30 00:35:00 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 2001-08-30 00:35:00 +0000 |
commit | c5772086a664c57a51821c635cb5d07af69d5c1a (patch) | |
tree | 88c1c43ff39c9c45ffedc195ca3ba30256cdbae1 | |
parent | 5644ced824ef122aebbaab631b7ef27e57308fae (diff) | |
download | nspr-hg-c5772086a664c57a51821c635cb5d07af69d5c1a.tar.gz |
Bugzilla bug 95784: added _PR_CleanupLayerCache and call it from
PR_Cleanup. The patch is contributed by jeff@NerdOne.com.
Modified files: primpl.h, prlayer.c, prinit.c, ptthread.c.
-rw-r--r-- | pr/include/private/primpl.h | 1 | ||||
-rw-r--r-- | pr/src/io/prlayer.c | 19 | ||||
-rw-r--r-- | pr/src/misc/prinit.c | 1 | ||||
-rw-r--r-- | pr/src/pthreads/ptthread.c | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/pr/include/private/primpl.h b/pr/include/private/primpl.h index 424d0f1e..826dc716 100644 --- a/pr/include/private/primpl.h +++ b/pr/include/private/primpl.h @@ -1735,6 +1735,7 @@ extern void _PR_InitMW(void); extern void _PR_InitRWLocks(void); extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me); extern void _PR_CleanupThread(PRThread *thread); +extern void _PR_CleanupLayerCache(void); extern void _PR_CleanupStacks(void); extern void _PR_CleanupThreads(void); extern void _PR_CleanupTPD(void); diff --git a/pr/src/io/prlayer.c b/pr/src/io/prlayer.c index 8cb5cda6..d74fa8be 100644 --- a/pr/src/io/prlayer.c +++ b/pr/src/io/prlayer.c @@ -743,4 +743,23 @@ void _PR_InitLayerCache() PR_ASSERT(NULL != identity_cache.ml); } /* _PR_InitLayerCache */ +void _PR_CleanupLayerCache(void) +{ + if (identity_cache.ml) + { + PR_DestroyLock(identity_cache.ml); + identity_cache.ml = NULL; + } + + if (identity_cache.name) + { + PRDescIdentity ident; + + for (ident = 0; ident <= identity_cache.ident; ident++) + PR_DELETE(identity_cache.name[ident]); + + PR_DELETE(identity_cache.name); + } +} /* _PR_CleanupLayerCache */ + /* prlayer.c */ diff --git a/pr/src/misc/prinit.c b/pr/src/misc/prinit.c index bfa59fa0..b9a4b07a 100644 --- a/pr/src/misc/prinit.c +++ b/pr/src/misc/prinit.c @@ -447,6 +447,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() * _PR_XXXCleanup() that we can call here. */ _PR_CleanupThreads(); + _PR_CleanupLayerCache(); _PR_CleanupStacks(); _PR_CleanupBeforeExit(); _pr_initialized = PR_FALSE; diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c index c573fe3f..3ae5feee 100644 --- a/pr/src/pthreads/ptthread.c +++ b/pr/src/pthreads/ptthread.c @@ -936,6 +936,7 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup() PR_DestroyLock(pt_book.ml); pt_book.ml = NULL; } _pt_thread_death(me); + _PR_CleanupLayerCache(); _pr_initialized = PR_FALSE; return PR_SUCCESS; } |