Ignore:
Timestamp:
04/19/04 02:40:59 (20 years ago)
Author:
Nicholas Riley
Message:

appswitch.1: Updated for appswitch 1.0.1.

appswitch.xcode: Converted to Xcode project from PBX project; still
using legacy target for now.

main.c: Updated copyright date. Fixed memory leak and bogus return
value in bundleIdentifierForApplication. Fixed a caller to properly
release then bundle identifier when it's finished with it.

README: Updated for appswitch 1.0.1. Summarize changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/appswitch/appswitch/main.c

    r145 r156  
    33 Nicholas Riley <appswitch@sabi.net>
    44
    5  Copyright (c) 2003, Nicholas Riley
     5 Copyright (c) 2003-04, Nicholas Riley
    66 All rights reserved.
    77
     
    250250    if (bundle != NULL) {
    251251        *bundleID = CFBundleGetIdentifier(bundle);
     252        if (*bundleID != NULL) {
     253            CFRetain(*bundleID);
    252254#if DEBUG
    253         CFShow(*bundleID);
     255            CFShow(*bundleID);
    254256#endif
     257        }
     258        CFRelease(bundle);
     259    } else {
     260        *bundleID = NULL;
    255261    }
    256262    CFRelease(url);
     
    346352                   if (!bundleIdentifierForApplication(&bundleID, path))
    347353                       errexit("can't get bundle location for process '%s' (PSN %ld.%ld, pid %ld)", name, psn.hi, psn.lo, info->UnixPID);
    348                    if (bundleID != NULL && CFStringCompare(OPTS.bundleID, bundleID, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
    349                        break;
     354                   if (bundleID != NULL) {
     355                       CFComparisonResult result = CFStringCompare(OPTS.bundleID, bundleID, kCFCompareCaseInsensitive);
     356                       if (result == kCFCompareEqualTo)
     357                           break;
     358                       CFRelease(bundleID);
     359                   }
    350360                   continue;
    351361               }
Note: See TracChangeset for help on using the changeset viewer.