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

  • Home
  • SEARCH
  • 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 8501199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:08:36+00:00 2026-06-11T01:08:36+00:00

I am using CGColorSpaceRef and when i release it, its crash. The Way i

  • 0

I am using CGColorSpaceRef and when i release it, its crash.
The Way i creates it and release

CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();

After doing some task and then release

CGColorSpaceRelease(colorSpace);

error shown by compiler is
“Assertion failed: (!state->is_singleton), function color_space_state_dealloc, file ColorSpaces/CGColorSpace.c, line 127”
And strange thing is happend when i not release colorspace or just set to nil its work fine, I don’t know why this happen.
Please help me on this. Thanks in Advance.
Have a happy day.

  • 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-11T01:08:38+00:00Added an answer on June 11, 2026 at 1:08 am

    It looks like you have over released the colorspace object. I have just run the following program and I get the error message you quoted.

    int main(int argc, char *argv[]) {
        @autoreleasepool {
            CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
    
            CGColorSpaceRelease(colorspace);
            CGColorSpaceRelease(colorspace);
        }
    }
    

    This SIGABRTs with the following error:

    Assertion failed: (!state->is_singleton), function color_space_state_dealloc, file ColorSpaces/CGColorSpace.c, line 127.
    

    If I only call CGColorSpaceRelease once the program compiles and runs without error.

    The static analyser (Shift-Cmd-B) may well be able to show you were you’ve gone wrong. It certainly flags the above code with “Reference counted object is used after it is released” on the second CGColorSpaceRelease call.

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

Sidebar

Related Questions

Using SQL Server 2008 R2 we are looking for a way to select the
Using Microsoft SQL Server 2005, is there any way to see when a table
I have a little method that does some CoreGraphics drawing. Today I was using
I'm using a trick to get gradient on my table cells. After I upgraded
I need to paint an image using some data and show it on my
Im using glReadPixels to grab screen shots of my opengl scene and then turning
Suppose I'm using CGColorSpaceRef . I'm wondering if there is a difference between releasing
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using a populated Table Type as the source for a TSQL-Merge. I want to
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question

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.