зеркало из https://github.com/mozilla/pjs.git
Bug 305041 shutdown crash [@ nsAttrValue::ToString] nsAttrValue::sEnumTableArray is null
r=bz sr=bz
This commit is contained in:
Родитель
7d22a1c86d
Коммит
9eac65e242
|
@ -48,6 +48,7 @@
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
PRBool nsDOMAttribute::sInitialized;
|
||||||
|
|
||||||
nsDOMAttribute::nsDOMAttribute(nsDOMAttributeMap *aAttrMap,
|
nsDOMAttribute::nsDOMAttribute(nsDOMAttributeMap *aAttrMap,
|
||||||
nsINodeInfo *aNodeInfo,
|
nsINodeInfo *aNodeInfo,
|
||||||
|
@ -87,11 +88,10 @@ NS_INTERFACE_MAP_END
|
||||||
NS_IMPL_ADDREF(nsDOMAttribute)
|
NS_IMPL_ADDREF(nsDOMAttribute)
|
||||||
NS_IMPL_RELEASE(nsDOMAttribute)
|
NS_IMPL_RELEASE(nsDOMAttribute)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsDOMAttribute::SetMap(nsDOMAttributeMap *aMap)
|
nsDOMAttribute::SetMap(nsDOMAttributeMap *aMap)
|
||||||
{
|
{
|
||||||
if (mAttrMap && !aMap) {
|
if (mAttrMap && !aMap && sInitialized) {
|
||||||
// We're breaking a relationship with content and not getting a new one,
|
// We're breaking a relationship with content and not getting a new one,
|
||||||
// need to locally cache value. GetValue() does that.
|
// need to locally cache value. GetValue() does that.
|
||||||
nsAutoString tmp;
|
nsAutoString tmp;
|
||||||
|
@ -726,6 +726,18 @@ nsDOMAttribute::UnsetProperty(nsIAtom* aPropertyName, nsresult* aStatus)
|
||||||
return doc->PropertyTable()->UnsetProperty(this, aPropertyName, aStatus);
|
return doc->PropertyTable()->UnsetProperty(this, aPropertyName, aStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsDOMAttribute::Initialize()
|
||||||
|
{
|
||||||
|
sInitialized = PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsDOMAttribute::Shutdown()
|
||||||
|
{
|
||||||
|
sInitialized = PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
nsAttributeChildList::nsAttributeChildList(nsDOMAttribute* aAttribute)
|
nsAttributeChildList::nsAttributeChildList(nsDOMAttribute* aAttribute)
|
||||||
|
|
|
@ -102,6 +102,11 @@ public:
|
||||||
virtual nsresult DeleteProperty(nsIAtom *aPropertyName);
|
virtual nsresult DeleteProperty(nsIAtom *aPropertyName);
|
||||||
virtual void* UnsetProperty(nsIAtom *aPropertyName,
|
virtual void* UnsetProperty(nsIAtom *aPropertyName,
|
||||||
nsresult *aStatus = nsnull);
|
nsresult *aStatus = nsnull);
|
||||||
|
static void Initialize();
|
||||||
|
static void Shutdown();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static PRBool sInitialized;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsString mValue;
|
nsString mValue;
|
||||||
|
|
|
@ -146,6 +146,7 @@
|
||||||
#include "nsIControllerContext.h"
|
#include "nsIControllerContext.h"
|
||||||
#include "nsDOMScriptObjectFactory.h"
|
#include "nsDOMScriptObjectFactory.h"
|
||||||
#include "nsAutoCopyListener.h"
|
#include "nsAutoCopyListener.h"
|
||||||
|
#include "nsDOMAttribute.h"
|
||||||
|
|
||||||
#include "nsHTMLCanvasFrame.h"
|
#include "nsHTMLCanvasFrame.h"
|
||||||
|
|
||||||
|
@ -335,6 +336,7 @@ Initialize(nsIModule* aSelf)
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
nsDOMAttribute::Initialize();
|
||||||
|
|
||||||
// Add our shutdown observer.
|
// Add our shutdown observer.
|
||||||
nsCOMPtr<nsIObserverService> observerService =
|
nsCOMPtr<nsIObserverService> observerService =
|
||||||
|
@ -370,6 +372,7 @@ Shutdown()
|
||||||
|
|
||||||
gInitialized = PR_FALSE;
|
gInitialized = PR_FALSE;
|
||||||
|
|
||||||
|
nsDOMAttribute::Shutdown();
|
||||||
nsRange::Shutdown();
|
nsRange::Shutdown();
|
||||||
nsGenericElement::Shutdown();
|
nsGenericElement::Shutdown();
|
||||||
nsEventListenerManager::Shutdown();
|
nsEventListenerManager::Shutdown();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче