VirtualBox

Changeset 608 in vbox for trunk/src/libs/xpcom18a4/xpcom


Ignore:
Timestamp:
Feb 4, 2007 9:29:38 PM (18 years ago)
Author:
vboxsync
Message:

worked around weird mac crash starting tstAPI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/glue/standalone/nsGREDirServiceProvider.cpp

    r1 r608  
    8989//*****************************************************************************
    9090// nsGREDirServiceProvider::nsISupports
    91 //*****************************************************************************   
     91//*****************************************************************************
    9292
    9393NS_IMPL_ISUPPORTS1(nsGREDirServiceProvider, nsIDirectoryServiceProvider)
    94  
     94
    9595//*****************************************************************************
    9696// nsGREDirServiceProvider::nsIDirectoryServiceProvider
    97 //*****************************************************************************   
     97//*****************************************************************************
    9898
    9999NS_IMETHODIMP
     
    125125//*****************************************************************************
    126126// Implementations from nsXPCOMGlue.h and helper functions.
    127 //*****************************************************************************   
     127//*****************************************************************************
    128128
    129129PRBool
     
    163163            CFRelease(bundleURL);
    164164        }
     165#if 0 /* bird: Causes crashes in objc_msgSend() later if released. I dunno why really.
     166               Something could be seriously screwed up somewhere else, but this'll have
     167               to do for now. (appBundle isn't released in the other place it's used.) */
    165168        CFRelease(appBundle);
     169#endif
    166170    }
    167171    if (*buffer) return PR_TRUE;
     
    178182        buf2[0] = '\0';
    179183
    180         /* 
     184        /*
    181185         * Env.var. VBOX_XPCOM_HOME first.
    182186         */
     
    186190            if (strlen(psz) < MAXPATHLEN)
    187191            {
    188                 if (!realpath(psz, buf2)) 
     192                if (!realpath(psz, buf2))
    189193                    strcpy(buf2, psz);
    190194                strcat(buf2, "/x"); /* for the filename stripping */
     
    213217            char buf[MAXPATHLEN];
    214218            int cchLink = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
    215             if (cchLink > 0 || cchLink != sizeof(buf) - 1) 
     219            if (cchLink > 0 || cchLink != sizeof(buf) - 1)
    216220             {
    217221                buf[cchLink] = '\0';
     
    232236            #ifdef DEBUG
    233237                printf("debug: (1) VBOX_XPCOM_HOME=%s\n", buf2);
    234             #endif 
     238            #endif
    235239                strcpy(szPath, buf2);
    236240                fPathSet = true;
     
    252256    // The MOZ_DEFAULT_VBOX_XPCOM_HOME variable can be set at configure time with
    253257    // a --with-default-mozilla-five-home=foo autoconf flag.
    254     // 
     258    //
    255259    // The idea here is to allow for builds that have a default VBOX_XPCOM_HOME
    256260    // regardless of the environment.  This makes it easier to write apps that
    257     // embed mozilla without having to worry about setting up the environment 
     261    // embed mozilla without having to worry about setting up the environment
    258262    //
    259263    // We do this py putenv()ing the default value into the environment.  Note that
     
    333337
    334338#endif
    335    
     339
    336340  return PR_FALSE;
    337341}
     
    350354  if (*sGRELocation)
    351355    return sGRELocation;
    352    
     356
    353357  char buffer[MAXPATHLEN];
    354    
     358
    355359  // If the xpcom library exists in the current process directory,
    356360  // then we will not use any GRE.  The assumption here is that the
     
    362366    struct stat libStat;
    363367    int statResult = stat(buffer, &libStat);
    364        
     368
    365369    if (statResult != -1) {
    366370      //found our xpcom lib in the current process directory
     
    395399  if (env && *env) {
    396400    sprintf(buffer, "%s" XPCOM_FILE_PATH_SEPARATOR GRE_CONF_NAME, env);
    397    
     401
    398402    if (GRE_GetPathFromConfigFile(buffer, sGRELocation)) {
    399403      return sGRELocation;
     
    420424  }
    421425#endif
    422  
     426
    423427#if XP_WIN32
    424428  char szKey[256];
    425429  HKEY hRegKey = NULL;
    426430  DWORD dwLength = MAXPATHLEN;
    427    
     431
    428432  // A couple of key points here:
    429433  // 1. Note the usage of the "Software\\Mozilla\\GRE" subkey - this allows
     
    438442  //
    439443  strcpy(szKey, GRE_WIN_REG_LOC GRE_BUILD_ID);
    440    
     444
    441445  if (::RegOpenKeyEx(HKEY_CURRENT_USER, szKey, 0, KEY_QUERY_VALUE, &hRegKey) == ERROR_SUCCESS) {
    442446    if (::RegQueryValueEx(hRegKey, "GreHome", NULL, NULL, (BYTE *)sGRELocation, &dwLength) != ERROR_SUCCESS) {
     
    567571static char sXPCOMPath[MAXPATHLEN];
    568572
    569 extern "C" const char* 
     573extern "C" const char*
    570574GRE_GetXPCOMPath()
    571575{
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette