On Tuesday 06 January 2015 12:35:01 René J.V. Bertin wrote: > On Tuesday January 06 2015 11:36:18 René J.V. Bertin wrote: > > And then the hackers' delight question: > > Staring at the code at almost 3am this morning it occurred to me that > > there is nothing wrong per se if QAction::isEnabled() returns false if > > the d pointer is NULL (an invalid QAction cannot/shouldn't be enabled), > > so I changed `return d->enabled` to `return d? d->enabled : false;` . > > Haven't seen the crash occur since ... > > The question here is of course: how wrong is that approach? > It's wrong because it's fixing the symptom (null d pointer) instead of fixing the cause (using an action that was already deleted).
My recommendation: run the app in valgrind. -- David Faure, fa...@kde.org, http://www.davidfaure.fr Working on KDE Frameworks 5 _______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel