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 7180755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:24:56+00:00 2026-05-28T17:24:56+00:00

In this Apple code: http://developer.apple.com/library/ios/#qa/qa1702/_index.html I can see that the session allocated at the

  • 0

In this Apple code: http://developer.apple.com/library/ios/#qa/qa1702/_index.html

I can see that the session allocated at the start of the init method is not released.

Why ? Is there a reason to this ?

  • 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-05-28T17:24:57+00:00Added an answer on May 28, 2026 at 5:24 pm

    A couple possible reasons come to mind:

    • Apple meant to convert this sample to ARC, and forgot about or missed the autorelease call later in the same snippet.
    • The ivar that gets session at the end of the init method is declared @property (assign), and so they deliberately wanted to keep it retained for now. If I remember right, this is poor practice – they should have autoreleased session and declared the @property (retain).
    • They hand-release the session later. Not strictly poor practice, but certainly confusing and hard to read, and may lead to a bug in maintenance later (when someone loses track of the retain–release balance).
    • This is genuinely a bug. Good catch!

    In any event, you’re right in that it’s somewhat inconsistent with good memory management practices. It’s hard to tell for sure, however, whether there’s a definitive reason it’s not released.

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

Sidebar

Related Questions

I'm using this sample code to view a PDF in my iPhone app: http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281-Intro-DontLinkElementID_2
I find this link everywhere for SQLite sample code ( http://developer.apple.com/library/ios/#samplecode/SQLiteBooks/index.html ) but either
All, In Apple's sample code DateCell http://developer.apple.com/library/ios/#samplecode/DateCell/Introduction/Intro.html the ivar pickerView is declared in MyTableViewController.h
I am looking at the 'Metronome' sample code from the iOS SDK ( http://developer.apple.com/library/ios/#samplecode/Metronome/Introduction/Intro.html
http://developer.apple.com/library/ios/#samplecode/Touches/Introduction/Intro.html I'm new to IOS development, and have been playing around with the IOS
I am following http://developer.apple.com/library/ios/#samplecode/CurrentAddress/Listings/Classes_MapViewController_m.html#//apple_ref/doc/uid/DTS40009469-Classes_MapViewController_m-DontLinkElementID_6 this is tutorial for MKreversGeocoder. My question is how to
I'm working off of some of Apple's sample code for mixing audio ( http://developer.apple.com/library/ios/#samplecode/MixerHost/Introduction/Intro.html
In this link it says it does: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html However I have searched for an
I'm trying to use the IKImageViewDemo provided by apple ( http://developer.apple.com/mac/library/samplecode/IKImageViewDemo/index.html ) and I'm
I considered using Apple's GLPaint example (http://developer.apple.com/library/ios/#samplecode/GLPaint) to do some finger painting. However, I

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.