fixed unix build crash based on NS_DEBUG flag
git-svn-id: svn://10.0.0.236/trunk@17444 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
@@ -13,7 +13,7 @@
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsDebug.h"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
#include "nsDTDUtils.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "CNavDTD.h"
|
||||
|
||||
static CTokenDeallocator gTokenKiller;
|
||||
|
||||
@@ -147,7 +147,7 @@ eHTMLTags nsTagStack::Last() const {
|
||||
*/
|
||||
nsDTDContext::nsDTDContext(int aDefaultSize) {
|
||||
#ifndef NS_DEBUG
|
||||
mStyles =new nsTagStack*[mCapacity];
|
||||
mStyles =new nsTagStack*[aDefaultSize];
|
||||
#endif
|
||||
mOpenStyles=0;
|
||||
nsCRT::zero(mStyles,mTags.mCapacity*sizeof(void*));
|
||||
@@ -160,9 +160,7 @@ nsDTDContext::nsDTDContext(int aDefaultSize) {
|
||||
*/
|
||||
nsDTDContext::~nsDTDContext() {
|
||||
#ifndef NS_DEBUG
|
||||
delete mTags;
|
||||
delete mStyles;
|
||||
mTags=0;
|
||||
mStyles=0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef DTDUTILS_
|
||||
#define DTDUTILS_
|
||||
|
||||
@@ -51,6 +53,7 @@
|
||||
void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
void DebugDumpContainmentRules2(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
|
||||
|
||||
class nsTagStack {
|
||||
public:
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
@@ -13,7 +13,7 @@
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsDebug.h"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
#include "nsDTDUtils.h"
|
||||
#include "CNavDTD.h"
|
||||
#include "CNavDTD.h"
|
||||
|
||||
static CTokenDeallocator gTokenKiller;
|
||||
|
||||
@@ -147,7 +147,7 @@ eHTMLTags nsTagStack::Last() const {
|
||||
*/
|
||||
nsDTDContext::nsDTDContext(int aDefaultSize) {
|
||||
#ifndef NS_DEBUG
|
||||
mStyles =new nsTagStack*[mCapacity];
|
||||
mStyles =new nsTagStack*[aDefaultSize];
|
||||
#endif
|
||||
mOpenStyles=0;
|
||||
nsCRT::zero(mStyles,mTags.mCapacity*sizeof(void*));
|
||||
@@ -160,9 +160,7 @@ nsDTDContext::nsDTDContext(int aDefaultSize) {
|
||||
*/
|
||||
nsDTDContext::~nsDTDContext() {
|
||||
#ifndef NS_DEBUG
|
||||
delete mTags;
|
||||
delete mStyles;
|
||||
mTags=0;
|
||||
mStyles=0;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef DTDUTILS_
|
||||
#define DTDUTILS_
|
||||
|
||||
@@ -51,6 +53,7 @@
|
||||
void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
void DebugDumpContainmentRules2(nsIDTD& theDTD,const char* aFilename,const char* aTitle);
|
||||
|
||||
|
||||
class nsTagStack {
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user