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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:14:33+00:00 2026-05-26T08:14:33+00:00

Here is the code within one of my methods, where imageRaw is an ivar:

  • 0

Here is the code within one of my methods, where imageRaw is an ivar:

if (imageRaw) 
    [imageRaw release]; // error occurs here
    .
    .
    .
if (anImage) 
    imageRaw = [[anImage scaleToFitWithin:maxImageSize interpolationQuality:kCGInterpolationHigh] retain];          

I have had this type of error occasionally, and I don’t really understand it. The only way it is non-nil is by assignment to an instance of the right class, UIImage, in this case.

Zombies are enabled.

All I am trying to do in a case like this is cause the existing instance to be deallocated so I can instantiate and assign/retain a new to the same pointer.

  • 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-26T08:14:33+00:00Added an answer on May 26, 2026 at 8:14 am

    I’m guessing what’s happening here is that at some point in your execution, this method is being called when you have something stored in imageRaw but don’t have anything in anImage. In this case, your object in imageRaw will be released but nothing new will be stored to it. This leaves the memory address for the deallocated object in imageRaw but the object no longer exists. Then, the next time you run the method, it checks to see if imageRaw is non-nil (which it is, since it still holds that memory address), tries to call release on that memory, and fails. To avoid this, you can make sure to set imageRaw to nil every time you call release on it:

    if (imageRaw)
        [imageRaw release];
        imageRaw = nil;
        .
        .
        .
    if (anImage)
        imageRaw = . . .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a snippet of code from within TurboGears 1.0.6: [dispatch.generic(MultiorderGenericFunction)] def run_with_transaction(func, *args, **kw):
Here is my code... basically it finds any page-NUMBER- within a variable and then
I am trying to load generics within the aspx page. Here is my code
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
enter code here I have a table on SQL server 2005 with bigint primary
The code here is X++. I know very little about it, though I am
enter code here Hi All, I have a simple windows service application that connects
Edit: The code here still has some bugs in it, and it could do

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.