Ticket #1589 (closed defect: fixed)

Opened 13 months ago

Last modified 2 months ago

1.3.5 Crash during closing the application.

Reported by: Luinar Owned by:
Priority: normal Milestone: 1.3.6
Component: qt-gui Version: 1.3.5
Keywords: Cc:

Description

Version 1.3.5 compiled at standard Debian stable (4.0 Etch) crash when closing the application with close button on the top right corner. The same situation with exit via the menu. If I disconnect myself from the ICQ server at first or not It doesn't matter. Some facts: Procesor: PIII Kernel: 2.6.18-686 (Debian precompiled) Output plugin: Qt-gui GCC: 4:4.1.1-15 LibQT4: 4.2.1-2+etch1 LibQT3: 3:3.3.4-3sarge1

Attachments

licq.backtrace (1.8 kB) - added by Luinar 13 months ago.
licq.backtrace.gdb (36 bytes) - added by Luinar 13 months ago.
mainwin.cpp.patch (0.6 kB) - added by Luinar 6 months ago.

Change History

Changed 13 months ago by Luinar

Changed 13 months ago by Luinar

Changed 13 months ago by Crazy_Hopper

The only suggestion I can think of here is: Please update your Qt3 version up to the latest and test again. Also, please let us know if it solved the problem or not.

Changed 8 months ago by flynd

Ticket #1621 seems to show the same crash.

Changed 6 months ago by Luinar

A short backstory: A friend of mine pointed out, that the crash occured, when she changed the skin to thomas. Another tests showed up, that problem is caused by setting the background pixmap.


The problem, I've localized, was in the file mainwin.cpp in plugin qt-gui - the destructor of the class CMainWindow is not well done. There seems to be a lot of memory not properly cleaned up. I'll add my patch file which solves the problem for me. Also there is a lot of memory, which need to care.

Changed 6 months ago by Luinar

Changed 6 months ago by flynd

  • priority changed from highest to normal

That patch is (at least partially) not needed. The btnSystem, lblStatus, lblMsg and userview objects are created with mainwin as their parent which means Qt libs are aware of them and will delete them automatically when the parent (mainwin) is deleted. As for the dialogs, Qt should delete all windows when the application is shut down.

If this patch actually solves your problem, could you please try and isolate which deletes actually makes the difference between crash and no crash.

I'm also lowering priority since this only happens while closing the application.

Changed 6 months ago by Luinar

OK I never worked with Qt library. The problem solves just the line with explicit destructoin of btnSystem, which has some pixmaps inside and which are not properly cleaned up. I ran some tests and found out that in the file ewidgets.cpp in the destructor ~CEButton, there is missing the destruction of pixmap pmCurrent. PS: I suggest make the destructor of the class CEButton virtual too as in your other classes to make it consistent and to avoid possible future problems with inheritance.

Changed 6 months ago by Luinar

I'm not sure if it is clean from the prewious post, where the problem is so i post it again.
File mainwin.cpp has proven to be OK.
In file ewidgets.cpp in destructor ~CEButton is missing line with destruction od pmCurrent:

CEButton::~CEButton()
{
  delete pmUpFocus;
  delete pmUpNoFocus;
  delete pmDown;
  delete pmCurrent; // <-- This line is missing
}

Changed 6 months ago by flynd

btnSystem has mainwin as parent so it will be deleted when mainwin is deleted (handled by Qt).

In CEButton, pmCurrent is a pointer that will always point to the same object as one of the other three pixmap pointers. So deleting pmCurrent just means that we will call delete twice on one of the pixmaps.

Changed 6 months ago by Luinar

OK Have you any ideas why doesn't crash occured when I either delete btnSystem explicitly or I add explicit deletion of pmCurrent in the destructor of CEButton? I'll try set the pmCurrrent to NULL in the destructor and post here the result.

Changed 6 months ago by flynd

Closed #1635 as a duplicate of this.

Changed 3 months ago by flynd

  • milestone 1.3.6 deleted

Changed 3 months ago by Luinar

  • status changed from new to closed
  • resolution set to fixed

In version 1.3.6-rc1 the problem disappears. So I'll close this ticket.

Changed 2 months ago by flynd

  • milestone set to 1.3.6
Note: See TracTickets for help on using tickets.