Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8925119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:36:44+00:00 2026-06-15T07:36:44+00:00

I wrote a small CLI program to delete specific Safari cookies for me. Functionally

  • 0

I wrote a small CLI program to delete specific Safari cookies for me. Functionally it’s fine, but it’s throwing up warnings about objects being “autoreleased with no pool in place”. My project has ARC enabled, hence why I don’t have any autorelease pools.

Here’s my code:

// NSLog replacement from http://stackoverflow.com/a/3487392/1376063
void IFPrint (NSString *format, ...) {
    va_list args;
    va_start(args, format);

    fputs([[[NSString alloc] initWithFormat:format arguments:args] UTF8String], stdout);
    fputs("\n", stdout);

    va_end(args);
}

int main(int argc, const char * argv[])
{
    NSString *urlSearchString;
    if (argc > 1) {
        urlSearchString = [[NSString alloc] initWithUTF8String:argv[1]];
    }
    else {
        IFPrint(@"No URL provided, quitting.");
        return 1;
    }

    NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

    NSString *filterString = [[NSString alloc] initWithFormat:@"domain ENDSWITH '%@'", urlSearchString];
    NSPredicate *filter = [NSPredicate predicateWithFormat:filterString];

    NSArray *matchedCookies = [cookieStorage.cookies filteredArrayUsingPredicate:filter];

    for (int i = 0; i < matchedCookies.count; i++) {
        [cookieStorage deleteCookie:[matchedCookies objectAtIndex:i]];
    }

    IFPrint(@"Removed %li cookies", matchedCookies.count);
    return 0;

}

The message I get is:

objc[15502]: Object 0x107b2bf00 of class NSThread autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug

Which appears in the Xcode debugger or when running the release binary directly (slight digression: shouldn’t these messages be stripped out of the “release” build?). The line that causes it seems to be:

NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];

Similarly, if I run it without passing an argument, I get a similar message:

objc[15630]: Object 0x100114ed0 of class __NSCFString autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[15630]: Object 0x100114f80 of class __NSCFData autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug

Which appears to come from the IFPrint function I’m using (however this doesn’t show up when I use the IFPrint when I provide a proper argument).

I’m a bit out of my depth here, can anyone show me where (and how) I’ve gone wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:36:47+00:00Added an answer on June 15, 2026 at 7:36 am

    ARC still requires an autorelease pool. Methods like [NSPredicate predicateWithFormat:filterString] continue to release an autoreleased object (though you no longer need to concern yourself all that much since ARC handles it). Furthermore the internal implementation of any library method you call may create arbitrarily many autoreleased objects while running.

    You should wrap your code in an autorelease pool via the @autoreleasepool mechanism.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a small program using a custom indexOf function but wanted to dismiss
I wrote a small program with Boost in c++. It works fine and so
I wrote this small program to find all occurrences of a substring in a
I wrote a small program to simply load a Wavefront OBJ mesh file and
I wrote a small program to evaluate the state of cellular automata and paint
I wrote a small test program with a sample class containing also self-defined constructor,
I wrote a small email sending program in java, it has from , to
I wrote a small program for iterating through a lot of files and applying
I am making a small program using C++/CLI that use TcpListener , I know
I wrote a small program in Java that do divide operation on pair of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.