зеркало из https://github.com/mozilla/pjs.git
Make sure componentMgr calls NR_ShutdownRegistry(), fixing MLKs and registry corruption from unflushed registry buffers.
r=dp,a=chofmann
This commit is contained in:
Родитель
94e7fc36a0
Коммит
fcba679114
|
@ -361,24 +361,14 @@ NS_IMPL_ISUPPORTS1( nsRegistryNode, nsIRegistryNode )
|
|||
NS_IMPL_ISUPPORTS1( nsRegistryValue, nsIRegistryValue )
|
||||
|
||||
/*-------------------------- nsRegistry::nsRegistry ----------------------------
|
||||
| Vanilla nsRegistry constructor. The first time called, it does |
|
||||
| NR_StartupRegistry. |
|
||||
| Vanilla nsRegistry constructor. |
|
||||
------------------------------------------------------------------------------*/
|
||||
nsRegistry::nsRegistry()
|
||||
: mReg(0), mCurRegFile(NULL), mCurRegID(0) {
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
// Ensure libreg is started.
|
||||
static PRBool libregStarted = PR_FALSE;
|
||||
if( !libregStarted ) {
|
||||
NR_StartupRegistry();
|
||||
libregStarted = PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef EXTRA_THREADSAFE
|
||||
mregLock = PR_NewLock();
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "xcDll.h"
|
||||
#include "prerror.h"
|
||||
#include "prmem.h"
|
||||
#include "NSReg.h"
|
||||
|
||||
#include "prcmon.h"
|
||||
#include "prthread.h" /* XXX: only used for the NSPR initialization hack (rick) */
|
||||
|
@ -241,6 +242,7 @@ nsresult nsComponentManagerImpl::Init(void)
|
|||
("nsComponentManager: Initialized."));
|
||||
|
||||
#ifdef USE_REGISTRY
|
||||
NR_StartupRegistry();
|
||||
PlatformInit();
|
||||
#endif
|
||||
|
||||
|
@ -280,6 +282,10 @@ nsComponentManagerImpl::~nsComponentManagerImpl()
|
|||
if (mMon)
|
||||
PR_DestroyMonitor(mMon);
|
||||
|
||||
#ifdef USE_REGISTRY
|
||||
NR_ShutdownRegistry();
|
||||
#endif /* USE_REGISTRY */
|
||||
|
||||
PR_LOG(nsComponentManagerLog, PR_LOG_ALWAYS, ("nsComponentManager: Destroyed."));
|
||||
|
||||
}
|
||||
|
|
|
@ -361,24 +361,14 @@ NS_IMPL_ISUPPORTS1( nsRegistryNode, nsIRegistryNode )
|
|||
NS_IMPL_ISUPPORTS1( nsRegistryValue, nsIRegistryValue )
|
||||
|
||||
/*-------------------------- nsRegistry::nsRegistry ----------------------------
|
||||
| Vanilla nsRegistry constructor. The first time called, it does |
|
||||
| NR_StartupRegistry. |
|
||||
| Vanilla nsRegistry constructor. |
|
||||
------------------------------------------------------------------------------*/
|
||||
nsRegistry::nsRegistry()
|
||||
: mReg(0), mCurRegFile(NULL), mCurRegID(0) {
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
// Ensure libreg is started.
|
||||
static PRBool libregStarted = PR_FALSE;
|
||||
if( !libregStarted ) {
|
||||
NR_StartupRegistry();
|
||||
libregStarted = PR_TRUE;
|
||||
}
|
||||
|
||||
#ifdef EXTRA_THREADSAFE
|
||||
mregLock = PR_NewLock();
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче