NS_RELEASE(pNetService);
nsServiceManager::ReleaseService(kNetServiceCID, pNetService);
int main(){	nsINetService * pNetService;    PLEventQueue *queue;    nsresult result;    nsRepository::RegisterFactory(kNetServiceCID, NETLIB_DLL, PR_FALSE, PR_FALSE);	nsRepository::RegisterFactory(kEventQueueServiceCID, XPCOM_DLL, PR_FALSE, PR_FALSE);	// Create the Event Queue for this thread...    nsIEventQueueService *pEventQService = nsnull;    result = nsServiceManager::GetService(kEventQueueServiceCID,                                          nsIEventQueueService::IID(),                                          (nsISupports **)&pEventQService);	if (NS_SUCCEEDED(result)) {      // XXX: What if this fails?      result = pEventQService->CreateThreadEventQueue();    }	// ask the net lib service for a nsINetStream:	result = NS_NewINetService(&pNetService, NULL);	if (NS_FAILED(result) || !pNetService)	{		printf("unable to initialize net serivce. \n");		return 1;	}    result =        pEventQService->GetThreadEventQueue(PR_GetCurrentThread(),&queue);    if (NS_FAILED(result) || !queue) {        printf("unable to get event queue.\n");        return 1;    }    	// now register a mime converter....    //	NET_RegisterContentTypeConverter (MESSAGE_RFC822, FO_NGLAYOUT, NULL, MIME_MessageConverter);    //	NET_RegisterContentTypeConverter (MESSAGE_RFC822, FO_CACHE_AND_NGLAYOUT, NULL, MIME_MessageConverter);	// okay, everything is set up, now we just need to create a test driver and run it...	nsSmtpTestDriver * driver = new nsSmtpTestDriver(pNetService,queue);	if (driver)	{		driver->RunDriver();		// when it kicks out...it is done....so delete it...		delete driver;	}	// shut down:	NS_RELEASE(pNetService);        return 0;}