From 6792f10afa0c454c616767cd5a8546e86800a099 Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Wed, 28 Jul 1999 08:27:38 +0000 Subject: [PATCH] Fully initialized arena so that it won't fail in destructor without first calling Init. git-svn-id: svn://10.0.0.236/trunk@41455 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/ds/nsArena.cpp | 6 ++++++ mozilla/xpcom/ds/nsArena.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/ds/nsArena.cpp b/mozilla/xpcom/ds/nsArena.cpp index e1b3c6a0fca..b5018d38469 100644 --- a/mozilla/xpcom/ds/nsArena.cpp +++ b/mozilla/xpcom/ds/nsArena.cpp @@ -19,6 +19,12 @@ #include "nsArena.h" #include "nsCRT.h" +ArenaImpl::ArenaImpl(void) +{ + NS_INIT_REFCNT(); + nsCRT::memset(&mPool, 0, sizeof(PLArenaPool)); +} + NS_IMETHODIMP ArenaImpl::Init(PRUint32 aBlockSize) { diff --git a/mozilla/xpcom/ds/nsArena.h b/mozilla/xpcom/ds/nsArena.h index 7a7443915bd..b69f4e4a4d6 100644 --- a/mozilla/xpcom/ds/nsArena.h +++ b/mozilla/xpcom/ds/nsArena.h @@ -27,7 +27,7 @@ // Simple arena implementation layered on plarena class ArenaImpl : public nsIArena { public: - ArenaImpl(void) { NS_INIT_REFCNT(); } + ArenaImpl(void); virtual ~ArenaImpl(); NS_DECL_ISUPPORTS