[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Odd behavior of File->Quit
From:       Jason Mott <jmott () jasonmott ! com>
Date:       2003-03-10 22:05:09
[Download RAW message or body]

I had this problem once. It was a while ago, and happened in an earlier 
version of KDE 3.0. The template I used had a slotFileQuit() slot with an 
iteration through windows that looked like so:


    for(w=memberList->first(); w!=0; w=memberList->current())
    {
      if(!w->close())
	break;
    }

At the time the iteration was written, memberList (which is a QPtrList now) 
was some other List implementation that removed the window from the list when 
current was called (or maybe it iterated the way next() does, I can't 
remember). Now, it doesn't, so that loop goes forever. If this is your 
problem, change current() to next() and all will be good again. Your code may 
look different, or even have a different bug, but the behavior you're 
explaining was the same as I was getting. It's worth a look.



On Sunday 09 March 2003 05:16 pm, Stephen Allewell wrote:
> I have found some odd behaviour regarding File->Quit.  The
> application I am developing, when Quit would seem to close
> correcly, but was still running with 100% cpu and taking more and
> more memory.  At first I put it down to my own dodgy coding and
> have spent considerable time trying to hunt down why it happens,
> but with no success.  This only happens with Quit. Using
> File->Close or clicking the Close button on the toplevel window,
> closes the program normally.
>
> I then created a default kapptemplate program, configured, make,
> etc.  Running it and immediatly using File->Quit would quit as
> expected.  Running it and loading a file, any file, then using
> File->Quit would segfault, attached is the crash log.
>
> Modifying the kmyapp.cpp setupActions function from
>
> KStdAction::quit(kapp, SLOT(quit()), actionCollection());
>
> to
>
> KStdAction::quit(kapp, SLOT(closeAllWindows()), \
> actionCollection());
> connect(kapp, SIGNAL(lastWindowClosed()), kapp, SLOT(quit()));
>
> cures the problem.
>
> My system is SuSE 8.1 upgraded to KDE 3.1 / QT 3.1.1, SuSE rpms
> linked to from kde.org.  I have also tried another machine with a
> new installation of SuSE 8.1, no updates, with the same result.
> I have also tried downloading and compiling the cvs
> 3_1_0_RELEASE, again with the same result
>
> Can anyone reproduce this?

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic