Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BAD_ACCESS drawInRect #63

Closed
Igor-Palaguta opened this issue Jul 28, 2014 · 7 comments
Closed

EXC_BAD_ACCESS drawInRect #63

Igor-Palaguta opened this issue Jul 28, 2014 · 7 comments

Comments

@Igor-Palaguta
Copy link

Hello,

I've used in FICEntityImageDrawingBlock code from documentation:

UIGraphicsPushContext(context);
[image drawInRect:contextBounds];
UIGraphicsPopContext();

It worked excellent, but I could replicate EXC_BAD_ACCESS in drawInRect method. I reset image cache, but some pending operation was still in queue

Scenarios is following

threadX inside FICEntityImageDrawingBlock

UIGraphicsPushContext(context);
image = SomeImageTransformation

switch to main thread

[ imageCache reset ];

return back to threadX

[image drawInRect:contextBounds];
UIGraphicsPopContext();

@Igor-Palaguta
Copy link
Author

As I can see from code FICImageTableEntry bytes (that were used during CGBitmapContextCreate initialization) are not available after reset, so any usage of this context finishes with EXC_BAD_ACCESS

@krisselden
Copy link

This bug makes testing very difficult.

@mallorypaine
Copy link
Contributor

This behavior is expected. You shouldn't call reset while images are in use or being processed.

Why exactly are you doing that?

Sent from my iPhone

On Aug 4, 2014, at 5:57 PM, Kris Selden notifications@github.com wrote:

This bug makes testing very difficult.


Reply to this email directly or view it on GitHub.

@Igor-Palaguta
Copy link
Author

During logout user from application, I want to reset everything

It can easily also be replicated with some code manipulation, after CGBitmapContextCreate call reset, and it reproduces easily

@mallorypaine
Copy link
Contributor

I pushed a commit to master which may resolve this. Please let me know.

@mallorypaine mallorypaine reopened this Aug 5, 2014
@krisselden
Copy link

I'm pretty sure that will work since it looks very similar to the workaround I use in the teardown of our tests.

@Igor-Palaguta
Copy link
Author

Thank you guys, I am sure it should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants