On Sat, May 27, 2006 at 04:29:15PM +0200, Georg Baum wrote:
> Am Samstag, 27. Mai 2006 15:20 schrieb Abdelrazak Younes:
> > Another idea... Maybe the QApplication destruction is happening too soon 
> > in the exit process, this patch remove the QLApplication destructor.
> 
> This was the right idea. The 'static' LQApplication changed the 
> destruction order in a way qt does not like. The attached patch fixes 
> this. Please take ownership of this and commit a suitable fix.

Erm.

Is this a extreme-trial-and-error-ing contest? 

If so, this should be indicated in the subject line somehow.

void foo()
{
        Ptr p = new P;
        ...
        delete p;
}

is destruction-wise equivalent to

void foo()
{
        P p;
}

Moreover, the former bad style as this is not exception safe.
std::auto_ptr<P> would be better. But as long as the object fits on the
stack there is no need for dynamic allocation here.

Your problem might have been that

void foo()
{
        static P p;
}

does indeed change destruction order.

Andre'

Reply via email to