Diff for /chimera/nsCocoaBrowserService.mm between versions 1.4 and 1.5

version 1.4, 2002/02/05 01:17:11 version 1.5, 2002/02/05 01:28:18
Line 47 Line 47
   
 nsAlertController* nsCocoaBrowserService::sController = nsnull;  nsAlertController* nsCocoaBrowserService::sController = nsnull;
 nsCocoaBrowserService* nsCocoaBrowserService::sSingleton = nsnull;  nsCocoaBrowserService* nsCocoaBrowserService::sSingleton = nsnull;
   PRUint32 nsCocoaBrowserService::sNumBrowsers = 0;
   
 // nsCocoaBrowserService implementation  // nsCocoaBrowserService implementation
 nsCocoaBrowserService::nsCocoaBrowserService()  nsCocoaBrowserService::nsCocoaBrowserService()
Line 66  NS_IMPL_ISUPPORTS3(nsCocoaBrowserService Line 67  NS_IMPL_ISUPPORTS3(nsCocoaBrowserService
 nsresult  nsresult
 nsCocoaBrowserService::InitEmbedding()  nsCocoaBrowserService::InitEmbedding()
 {  {
     sNumBrowsers++;
     
   if (sSingleton)    if (sSingleton)
     return NS_OK;      return NS_OK;
   
Line 137  nsCocoaBrowserService::InitEmbedding() Line 140  nsCocoaBrowserService::InitEmbedding()
 }  }
   
 void  void
   nsCocoaBrowserService::BrowserClosed()
   {
       sNumBrowsers--;
       if (!sSingleton && sNumBrowsers == 0) {
           // The app is terminating *and* our count dropped to 0.
           NS_TermEmbedding();
       }
   }
   
   void
 nsCocoaBrowserService::TermEmbedding()  nsCocoaBrowserService::TermEmbedding()
 {  {
     NS_RELEASE(sSingleton);      NS_RELEASE(sSingleton);
    printf("Terminating embedding and shutting down.\n");    
    NS_TermEmbedding();    if (sNumBrowsers == 0)
         NS_TermEmbedding(); // Safe to terminate now.
     
     // Otherwise we cannot yet terminate.  We have to let the death of the browser windows
     // induce termination.
 }  }
   
 #define NS_ALERT_NIB_NAME "alert"  #define NS_ALERT_NIB_NAME "alert"

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>