KConfigDialog crash and fix for it

Joris Guisson joris.guisson at gmail.com
Sat Oct 20 12:30:25 BST 2007


Hi,

I have noticed that there is a crash when you use KConfigDialog. When you
add a page, then remove it again, and close the dialog with cancel (if your
press OK, it doesn't crash).

After some digging around in the code, I noticed there is this QMap
managerForPage in KConfigDialog. Which gets iterated over when you press
cancel. This map contains pointers to KConfigDialogManager objects (which
are created per page), and those should be removed when a page is removed
from the dialog, but this doesn't happen.

KConfigDialogManager goes around checking a bunch of widgets which are part
of a page and any properly coded program will delete those when it removes a
page from a KConfigDialog. So in order to fix this crash you need clean up
these KConfigDialogManager objects when the corresponding page is removed.

The attached patch does this.


Joris,

Btw, if you want to reproduce the crash, compile and install ktorrent
(trunk/extagear/network/ktorrent), load the webinterface plugin in the
settings dialog, then unload it again, and close the dialog with cancel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071020/11295ab8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfigdialog.patch
Type: text/x-patch
Size: 2417 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071020/11295ab8/attachment.bin>


More information about the kde-core-devel mailing list