KDirOperator::resetCursor() crash

David Faure faure at kde.org
Tue Oct 16 12:01:17 BST 2007


On Tuesday 16 October 2007, Jarosław Staniek wrote:
> In my app there is a structure declared with K_GLOBAL_STATIC containing a 
> pointer to GUI with KFileWidget. 

I don't think this is a good idea. Complex widgets don't make good "global static" objects,
because of the things they might need in their destructors indeed.

I don't mind a if(qApp) being added, but I do think that this is a bad idea and that you should
create the file widget when you need it, and delete it when you don't need it anymore.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list