Commit a894a9a6 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

avoid crashing when widget or source is null

parent 62a2b689
......@@ -87,11 +87,15 @@ void dtkWidgetsMenuItemDIY::clear(void)
{
QLayoutItem *child;
if (d->source) {
while ((child = d->source->layout()->takeAt(0)) != 0)
delete child;
}
if (d->widget) {
while ((child = d->widget->layout()->takeAt(0)) != 0)
delete child;
}
}
void dtkWidgetsMenuItemDIY::setSizePolicy(QSizePolicy::Policy policy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment