[PATCH] KFontChooser crashes when changing to fixed fonts
kloecker at kde.org
Sun Feb 24 12:37:19 GMT 2008
On Saturday 23 February 2008, Chusslove Illich wrote:
> > [: Thomas McGuire :]
> > The reason is in setFamilyBoxItems() [...] causes a signal to be
> > emitted and then _k_family_chosen_slot() is called [...] will
> > crash.
> Nothing ought to react during setFamilyBoxItems() itself, as it is
> just an initialization step for setting up the display, and family
> selection etc. is always performed afterwards (in setupDisplay(),
> which setFont() calls at the end). The attached patch should be more
> according to this description. (Or, switching off the passive voice:
> I screwed up :)
> Does it also fix the issue for you?
Even if this patch fixes the issue it would be wise to add an assert
(for the debug build) on familyListBox->currentItem() (and a
corresponding comment) to make sure that a regression is noticed early
Moreover, I'd still apply Thomas patch. It's nice that
familyListBox->currentItem() should never by NULL, but better safe than
Just stating the obvious: All dereferenced pointers SHOULD  be
guarded by NULL-pointer checks (and, if appropriate, corresponding
asserts should be added). And if a NULL-pointer check is omitted for
whatever reasons (are there actually valid reasons?) an assert SHOULD
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 194 bytes
Desc: This is a digitally signed message part.
More information about the kde-core-devel