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

Memory problem with JotView #40

Open
CoderMaurice opened this issue Apr 16, 2019 · 5 comments
Open

Memory problem with JotView #40

CoderMaurice opened this issue Apr 16, 2019 · 5 comments

Comments

@CoderMaurice
Copy link

When I want to close it, [JotView dealloc] will never be executed.

@CoderMaurice
Copy link
Author

adam, help!!!

@adamwulf
Copy link
Owner

Something must still be holding a reference to the JotView after you close it. double check that you've nil'd all references to the view in your controllers when you close it.

The best way i've found to debug memory problems like this is to use Instruments tool Allocations, and turn on reference counting in it. that'll help track down which reference is holding onto the JotView.

@CoderMaurice
Copy link
Author

CoderMaurice commented Apr 18, 2019

I ran the demo and did two things.

  1. present ViewController (JotView inside), then dismiss it
  2. Repeat the first step

the dealloc method has not been executed and the memory will keep rising.

image
I modified the saveImage method in ViewController, now the ViewController can be released, but jotview won't.
The problem is in the JotView

@CoderMaurice
Copy link
Author

well, the displayLink in the JotView caused a reference problem

@adamwulf
Copy link
Owner

Great find! i've pushed up your fix for the saveImage issue you found. I also now call [jotView invalidate] whenever the view controller removeFromParentViewController. That should kill the displayLink and allow the view controller to be released whenever the controller is removed.

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

2 participants