Implement didReceiveMemoryWarning #712

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

Projects

None yet

3 participants

@markrickert
Member

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
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

@squidpunch
Contributor

👍

@markrickert markrickert added a commit that referenced this issue Jul 4, 2015
@markrickert markrickert Implements on_memory_warning for screens.
With tests and documentation. Closes #712
6df1011
@markrickert markrickert added a commit that referenced this issue Jul 4, 2015
@markrickert markrickert Implements on_memory_warning for screens.
With tests and documentation. Closes #712
2207a54
@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