deleteLater
Vladimir Prus
ghost at cs.msu.su
Tue May 6 07:11:24 UTC 2008
I see that in many places, we use deleteLater to delete object.
For example, in TextDocument::close
//close all views and then delete ourself
foreach (Sublime::Area *area,
Core::self()->uiControllerInternal()->allAreas())
{
QList<Sublime::View*> areaViews = area->views();
foreach (Sublime::View *view, areaViews) {
if (views().contains(view)) {
area->removeView(view);
view->deleteLater();
}
}
}
Can somebody give me a concrete use case where using deleteLater, *here*
might fix a *real* problem? It seems highly unlikely that the ::close
method will *ever* be called, directly or indirectly, from within view.
- Volodya
More information about the KDevelop-devel
mailing list