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.
It looks like you have over released the
colorspaceobject. I have just run the following program and I get the error message you quoted.This
SIGABRTs with the following error:If I only call
CGColorSpaceReleaseonce 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
CGColorSpaceReleasecall.