diff --git a/editor/base/nsEditFactory.cpp b/editor/base/nsEditFactory.cpp index 76245ffe50b0..0fb55da333d9 100644 --- a/editor/base/nsEditFactory.cpp +++ b/editor/base/nsEditFactory.cpp @@ -39,7 +39,7 @@ getEditFactory(nsIFactory **aFactory) { nsEditFactory *factory = new nsEditFactory(getter_AddRefs(g_pNSIFactory)); *aFactory = g_pNSIFactory; - NS_IF_RELEASE(*aFactory); + NS_IF_ADDREF(*aFactory); if (factory) result = NS_OK; } diff --git a/editor/core/nsEditFactory.cpp b/editor/core/nsEditFactory.cpp index 76245ffe50b0..0fb55da333d9 100644 --- a/editor/core/nsEditFactory.cpp +++ b/editor/core/nsEditFactory.cpp @@ -39,7 +39,7 @@ getEditFactory(nsIFactory **aFactory) { nsEditFactory *factory = new nsEditFactory(getter_AddRefs(g_pNSIFactory)); *aFactory = g_pNSIFactory; - NS_IF_RELEASE(*aFactory); + NS_IF_ADDREF(*aFactory); if (factory) result = NS_OK; }