[interfacekit] Re: [Open-beos-cvs]CVS: current/src/kits/appApplication.cpp,1.34,1.35

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: Interface Kit <interfacekit@xxxxxxxxxxxxx>
  • Date: Wed, 14 Jan 2004 21:10:57 +0100

On 2004-01-13 at 01:16:44 [+0100], Adrian Oanca wrote:
> Update of /cvsroot/open-beos/current/src/kits/app
> In directory sc8-pr-cvs1:/tmp/cvs-serv680
> 
> Modified Files:
>     Application.cpp
> Log Message:
> It know asks and waits for all loopers to quit
> 
> Index: Application.cpp
> CVS Browser:
> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/open-beos/current/src/kits/app/Application.cpp
> ===================================================================
> RCS file: /cvsroot/open-beos/current/src/kits/app/Application.cpp,v
> retrieving revision 1.34
> retrieving revision 1.35
> diff -u -d -r1.34 -r1.35
> --- Application.cpp    19 Dec 2003 07:19:14 -0000    1.34
> +++ Application.cpp    13 Jan 2004 00:16:42 -0000    1.35
> @@ -226,6 +226,32 @@
>  {
>      // unregister from the roster
>      BRoster::Private().RemoveApp(Team());
> +
> +    // tell all loopers(usualy windows) to quit. Also, wait for them.
> +    BLooper*    Looper = NULL;
> +    BList        looperList;
> +    {
> +        using namespace BPrivate;
> +        BObjectLocker<BLooperList> ListLock(gLooperList);
> +        if (ListLock.IsLocked())
> +            gLooperList.GetLooperList(&looperList);
> +    }
> +
> +    for (int32 i = 0; i < looperList.CountItems(); i++)
> +    {
> +        Looper    = dynamic_cast<BLooper*>((BLooper*)looperList.ItemAt(i));
> +        if (Looper && Looper != this)
> +        {
> +            Looper->Lock();
> +            Looper->Quit();
> +        }
> +    }

That's not correct. In the application destructor only the windows should be 
Quit(), not all 
looper.

I also believe, that it would be better to remove the app from the roster after 
its windows 
are gone. Otherwise all the roster services are already unavailable by the time 
the windows 
are destroyed.

CU, Ingo

Other related posts: