[prev in list] [next in list] [prev in thread] [next in thread]
List: haiku-commits
Subject: Re: [Haiku-commits] r33375 - in haiku/trunk/src/preferences:
From: Michael Weirauch <dev () m-phasis ! de>
Date: 2009-09-30 22:09:28
Message-ID: ba1cb1a80909301509y305078bbr2d636ae11167bf96 () mail ! gmail ! com
[Download RAW message or body]
2009/9/30 PulkoMandy <pulkomandy@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?
Michael
_______________________________________________
Haiku-commits mailing list
Haiku-commits@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/haiku-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic