[KDE/Mac] crashing Qt through a QObject's dtor

René J.V. Bertin rjvbertin at gmail.com
Tue Jan 6 11:35:01 UTC 2015


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?

R.


More information about the kde-mac mailing list