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

Implement didReceiveMemoryWarning #712

Closed
markrickert opened this Issue Jul 2, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@markrickert
Member

markrickert commented Jul 2, 2015

Idea from @paulsturgess' Inspect 2015 talk. Maybe we should implement something on PM::Screen that calls your screen's method:

def memory_warning
  # do something here to clean up memory
end

I'd also say maybe we should auto-print a message to the screen when a memory warning is received and the user hasn't implemented the memory_warning method in their screen.

Thoughts?

@jamonholmgren

This comment has been minimized.

Show comment
Hide comment
@jamonholmgren

jamonholmgren Jul 2, 2015

Member

I love it. I think on_memory_warning would be consistent with the API. I think we could do mp "Received memory warning in #{self.inspect}. Implementon_memory_warning.", force_color: :red or something. As a developer, I'd want to deal with those for sure.

I faked the output here for discussion:

screen shot 2015-07-02 at 2 41 52 pm

Member

jamonholmgren commented Jul 2, 2015

I love it. I think on_memory_warning would be consistent with the API. I think we could do mp "Received memory warning in #{self.inspect}. Implementon_memory_warning.", force_color: :red or something. As a developer, I'd want to deal with those for sure.

I faked the output here for discussion:

screen shot 2015-07-02 at 2 41 52 pm

@squidpunch

This comment has been minimized.

Show comment
Hide comment
@squidpunch

squidpunch Jul 2, 2015

Contributor

👍

Contributor

squidpunch commented Jul 2, 2015

👍

markrickert added a commit that referenced this issue Jul 4, 2015

Implements on_memory_warning for screens.
With tests and documentation. Closes #712

markrickert added a commit that referenced this issue Jul 4, 2015

Implements on_memory_warning for screens.
With tests and documentation. Closes #712

@jamonholmgren jamonholmgren closed this in #714 Jul 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment