SetDestructor

git-svn-id: svn://10.0.0.236/trunk@22403 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
1999-02-28 19:04:47 +00:00
parent 6cc33f9350
commit 2e0ae08fae
9 changed files with 99 additions and 6 deletions

View File

@@ -18,12 +18,17 @@
#include "nsGenericFactory.h"
nsGenericFactory::nsGenericFactory(ConstructorProcPtr constructor) : mConstructor(constructor)
nsGenericFactory::nsGenericFactory(ConstructorProcPtr constructor)
: mConstructor(constructor), mDestructor(NULL)
{
NS_INIT_ISUPPORTS();
}
nsGenericFactory::~nsGenericFactory() {}
nsGenericFactory::~nsGenericFactory()
{
if (mDestructor != NULL)
(*mDestructor) ();
}
NS_METHOD nsGenericFactory::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
@@ -59,6 +64,12 @@ NS_IMETHODIMP nsGenericFactory::SetConstructor(ConstructorProcPtr constructor)
return NS_OK;
}
NS_IMETHODIMP nsGenericFactory::SetDestructor(DestructorProcPtr destructor)
{
mDestructor = destructor;
return NS_OK;
}
NS_METHOD nsGenericFactory::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
{
// sorry, aggregation not spoken here.