[haiku-appserver] Re: [Haiku-commits] r12524 - haiku/trunk/src/servers/app

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Mon, 2 May 2005 13:59:37 +0200 (MEST)

On Mon, 2 May 2005, Stefano Ceccherini at BerliOS wrote:

> Author: jackburton
> Date: 2005-05-02 10:29:37 +0200 (Mon, 02 May 2005)
> New Revision: 12524
>
> Modified:
>   haiku/trunk/src/servers/app/AppServer.cpp
> Log:
> Added a TODO item with a bad bug report
>
> Modified: haiku/trunk/src/servers/app/AppServer.cpp
> ===================================================================
> --- haiku/trunk/src/servers/app/AppServer.cpp 2005-05-01 06:26:49 UTC (rev 
> 12523)
> +++ haiku/trunk/src/servers/app/AppServer.cpp 2005-05-02 08:29:37 UTC (rev 
> 12524)
> @@ -609,6 +609,13 @@
>                                       if(srvapp)
>                                       {
>                                               status_t                temp;
> +                                             // TODO: This call never 
> returns, thus screwing the
> +                                             // app server completely: it's 
> easy to test:
> +                                             // run any test app which 
> creates a window, quit
> +                                             // the application clicking on 
> the window's "close" button,
> +                                             // and try to launch the 
> application again. It won't start.
> +                                             // Anyway, this should be moved 
> to ~ServerApp() (which has already
> +                                             // a "kill_thread()" call, btw).
>                                               wait_for_thread(srvapp_id, 
> &temp);
>                                               delete srvapp;
>                                               srvapp= NULL;

That comment made me have a quick look at ServerApp::~ServerApp(). To end 
the life of the thread with kill_thread() is a bit drastic a measure. It 
might leave objects the thread is currently manipulating in a inconsistent 
state, locks held by the thread with never be freed (in worst case 
global locks like those of the memory allocator, which will cause the 
whole app to malfunction), memory will leak, on_exit_thread() hooks won't 
be called... Better make sure to grant the thread a peaceful death.

CU, Ingo

Other related posts: