[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Jun 28 02:41:50 CEST 2004


Sorry to clarify, the assertion would not fail since it ensures that it's not 
null before assignment (which would be a leak), but it would mean that 
operator new() returned null, which means that it would have crashed in the 
next line or two instead or the constructor was never called, depending on 
the allocator behaviour.  All in all we would be toast long before the if().


On June 27, 2004 20:30, George Staikos wrote:
> Every single check for KstApp::inst() or ::inst being null is redundant and
> unneeded.  If KstApp::inst is null, then the first assertion must fail and
> the app never could even start.  It's just wasted cycles and unnecessary
> branches.  See kst.cpp:
>
> KstApp::KstApp(QWidget *parent, const char *name)
>
> : KMdiMainFrm(parent, name) {
>
>   assert(!::inst);
>
>   ::inst = this;
>
> On June 25, 2004 15:54, Andrew Walker wrote:
> > CVS commit by arwalker:
> >
> > Fixed several actual and potential crashes.

-- 
George Staikos
KDE Developer			http://www.kde.org/
Staikos Computing Services Inc.	http://www.staikos.net/



More information about the Kst mailing list