mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-12 12:05:03 -05:00
ffe73b7c9f
There are at least two significant memory leaks in Yaaic, which cause the client to force close after a few hours with an OutOfMemoryException: (1) The IRCService holds Conversation objects, which contain a MessageListAdapter, which have references to the ConversationActivity context. This causes Activity contexts to outlast the Activity, causing a significant memory leak over time. Fix this by holding the MessageListAdapter in the ConversationActivity's DeckAdapter instead of in the Conversation objects. The DeckAdapter's lifecycle matches that of the Activity, so this prevents the leak. (2) Every call to DeckAdapter.getView()/renderConversation() creates a new MessageListView and adds it to the deck. But adding the view to the deck causes the deck to take a reference to the view, leaking the MessageListView until the Activity is finished. (This has the effect of exacerbating the first leak, since the Activity context holds a reference to the deck.) Fix this leak by caching MessageListViews in the DeckAdapter, and returning an existing MessageListView for a Conversation in getView() if one already exists. |
||
---|---|---|
.. | ||
Broadcast.java | ||
Channel.java | ||
Conversation.java | ||
Extra.java | ||
Identity.java | ||
Message.java | ||
Query.java | ||
Scrollback.java | ||
Server.java | ||
ServerInfo.java | ||
Settings.java | ||
Status.java | ||
User.java |