Fixes leaking queries and their results. Fixes memory leaking xml texts in chat panel. Autoaway configuration saved while typing.

cusax-fix
Damian Minkov 14 years ago
parent 5f8c5a9063
commit 01fabbeeec

@ -1772,4 +1772,15 @@ private static String getContactAvatar(
return GuiActivator.getResources().getImageURL(
"service.gui.DEFAULT_USER_PHOTO_SMALL").toString();
}
/**
* Releases the resources allocated by this instance throughout its lifetime
* and prepares it for garbage collection.
*/
public void dispose()
{
super.dispose();
clear();
}
}

@ -906,7 +906,7 @@ private void appendChatMessage(ChatMessage chatMessage)
* Passes the message to the contained <code>ChatConversationPanel</code>
* for processing and replaces the specified message with this one.
*
* @param chatMessage The message used as a correction.
* @param message The message used as a correction.
*/
private void applyMessageCorrection(ChatMessage message)
{

@ -69,6 +69,15 @@ public class UIFilterQuery
*/
private final ContactList contactList;
/**
* Map of the created show more contacts for a query.
* We stored them, so we can remove them (sometimes those
* contacts are not added to UI, so they are not removed and
* not cleared)
*/
private final Map<ContactQuery,ShowMoreContact> showMoreContactMap
= new HashMap<ContactQuery, ShowMoreContact>();
/**
* Creates an instance of <tt>UIFilterQuery</tt> by specifying the parent
* <tt>ContactList</tt>.
@ -299,6 +308,14 @@ private void cancelQuery(Object query)
contactQuery.removeContactQueryListener(contactList);
if (!isSucceeded && contactQuery.getQueryResults().size() > 0)
isSucceeded = true;
// removes ShowMoreContact and clears it
ShowMoreContact showMoreContact
= showMoreContactMap.remove(contactQuery);
if(showMoreContact != null)
{
showMoreContact.setContactNode(null);
}
}
else if (query instanceof MetaContactQuery)
{
@ -343,6 +360,7 @@ private void contactReceived(ContactQuery query, SourceContact contact)
ShowMoreContact moreInfoContact
= new ShowMoreContact(query, queryResults, getMaxResultShown());
showMoreContactMap.put(query, moreInfoContact);
ContactSourceService contactSource = query.getContactSource();

@ -219,6 +219,13 @@ public ContactNode getContactNode()
public void setContactNode(ContactNode contactNode)
{
this.contactNode = contactNode;
// contactNode is null, when the the ui contact is removed/cleared
// we must free resources
if(contactNode == null)
{
GuiActivator.getContactList().removeContactListListener(this);
}
}
/**

@ -11,6 +11,7 @@
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import net.java.sip.communicator.plugin.generalconfig.*;
import net.java.sip.communicator.util.swing.*;
@ -102,6 +103,15 @@ public void stateChanged(ChangeEvent e)
"plugin.autoaway.AWAY_MINUTES")));
timerPanel.add(timer);
try
{
// changes that are valid will be saved immediately while typing
((DefaultFormatter)((JSpinner.DefaultEditor)timer.getEditor())
.getTextField().getFormatter()).setCommitsOnValidEdit(true);
}
catch(Throwable t)
{}
JPanel mainPanel = new TransparentPanel(new BorderLayout(5, 5));
mainPanel.add(enable, BorderLayout.NORTH);

Loading…
Cancel
Save