[Haiku-commits] r33375 - in haiku/trunk/src/preferences: appearance bluetooth
Jérôme Duval
korli at users.berlios.de
Thu Oct 1 19:17:47 CEST 2009
2009/10/1 Michael Weirauch <dev at m-phasis.de>:
> 2009/9/30 PulkoMandy <pulkomandy at gmail.com>:
>> What other solution do you suggest, in order not to leak the be_catalog in
>> any case and be able to use it as needed ?
>> GSoC is finished now, I'd be happy if other people started to improve the
>> code of the locale kit. I'm sure you can help :)
>
> In expectation that might be utterly wrong: :)
>
> Index: src/kits/locale/Locale.cpp
> ===================================================================
> --- src/kits/locale/Locale.cpp (revision 33370)
> +++ src/kits/locale/Locale.cpp (working copy)
> @@ -24,6 +24,8 @@
>
> BLocale::~BLocale()
> {
> + delete be_app_catalog;
> + delete be_catalog;
> }
>
>
> @@ -46,9 +48,7 @@
>
> status_t
> BLocale::GetAppCatalog(BCatalog *catalog) {
> - if (!catalog)
> - return B_BAD_VALUE;
> if (be_catalog)
> debugger( "GetAppCatalog() has been called while
> be_catalog != NULL");
> - return BCatalog::GetAppCatalog(catalog);
> + return BCatalog::GetAppCatalog(catalog ? catalog : new BCatalog);
> }
>
>
> Allows for be_locale->GetAppCatalog(NULL); and makes sure the be_[app_]catalog
> are being freed when my printfs() didn't fool me.
>
> Whenever the locale changes, call GetAppCatalog again and work with
> be_[app_]catalog?
This would be the idea, yes.
Bye,
Jérôme
More information about the Haiku-commits
mailing list