[Psi-devel] BUG & FIX dealing w/ tabs

Nolan Eakins sneakin at semanticgap.com
Fri Jun 3 20:34:10 PDT 2005


Psi segfaulted on me not to long ago. I think I've isolated everything
and have a possible fix. The steps that I think should reproduce it are:

	1. open chat to you or someone else
	2. open a 2nd chat to someone else
	3. close the 1st chat
	4. send a message w/ type 'chat'
	5. receive the event by clicking popup or in the roster
	6. boom

The backtrace led me to PsiAccount::ensureChatDlg, line 2256. Apparently
  PsiCon::getManagingTabs can return a NULL and this is not checked for
which causes the segfault because 'window' is NULL when it crashes.

So I changed line 2256 to read:
		if(window && window->isHidden()) {
instead of:
		if(window->isHidden()) {

That seems to prevent the crash assuming my steps above are correct. So
somebody needs to confirm this, and to ensure that nothing else needs to
be done when 'window == NULL'.

- Nolan

Crazy side note, just something my eye caught in my working copy. I've
added '\' to show the line my mind detected:
		// we need to check if window is NULL, because it can be
		// open chat to you or someone else
		// open\a 2nd chat to someone else
		// close\the 1st chat
		// send a\message w/ type 'chat'
		// receive\the event by clicking popup or in the roster
		// boom    \
                             \
		if(window && window->isHidden()) {
			const QPixmap *pp = c->icon();
			QPixmap p;

Signs point to that being the bug. :-)



More information about the Psi-devel-affinix.com mailing list