[haiku-commits] Re: BRANCH midar-github.master - in src: kits/app kits/support apps/soundrecorder kits/locale

  • From: Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 19 Nov 2012 18:29:17 +0100

On 2012-11-19 at 18:00:44 [+0100], midar-github.master 
<community@xxxxxxxxxxxx> wrote:
[ ... ]
> ############################################################################
> 
> Commit:      98f3a527189fb49f51ceeb51a3e292db25521a3a
> Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
> Date:        Mon Nov 19 16:31:31 2012 UTC
> 
> Fix a crash that happens when closing ANY program.
> 
> It seems GCC never called the destructor when a program was
> terminating.

Which destructor do you mean?

> 
> ----------------------------------------------------------------------------
> 
> diff --git a/src/kits/locale/MutableLocaleRoster.cpp 
> b/src/kits/locale/MutableLocaleRoster.cpp
> index 3d51c99..b8b6bd7 100644
> --- a/src/kits/locale/MutableLocaleRoster.cpp
> +++ b/src/kits/locale/MutableLocaleRoster.cpp
> @@ -933,6 +933,9 @@ MutableLocaleRoster::UnloadCatalog(BCatalogData* 
> catalog)
>      if (!catalog)
>          return B_BAD_VALUE;
>  
> +    if (RosterData::Default() == NULL)
> +        return B_ERROR;
> +

The added check is ok, but I'm afraid this is just hiding another problem - 
RosterData::Default() should never be NULL (unless there's not enough 
memory), so why is it NULL in this case? 
Either it never has been initialized properly (i.e. pthread_once() doesn't 
work), or there's a problem in the way (order) the objects are being deleted. 
I'd assume the latter.

cheers,
        Oliver

Other related posts: