root-EmptyEnumeratorImpl
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 88 3c4963bbc6b89c5e784bc7f4017305a65bef9b3f
permissions -rw-r--r--
State as of now

diff --git a/xpcom/glue/nsEnumeratorUtils.cpp b/xpcom/glue/nsEnumeratorUtils.cpp
--- a/xpcom/glue/nsEnumeratorUtils.cpp
+++ b/xpcom/glue/nsEnumeratorUtils.cpp
@@ -64,8 +64,10 @@
     NS_IMETHOD GetNext(nsAString& aResult);
 
     static EmptyEnumeratorImpl* GetInstance() {
-        if (!gInstance)
+        if (!gInstance) {
             gInstance = new EmptyEnumeratorImpl();
+            NS_RootUntilShutdown(gInstance);
+        }
         return gInstance;
     }