Add and use an _Init() method for BarTeamInfo

This commit is contained in:
John Scipione
2013-04-06 22:45:33 -04:00
parent de49a051ea
commit 542de916c4
2 changed files with 14 additions and 4 deletions
+10 -4
View File
@@ -960,8 +960,7 @@ BarTeamInfo::BarTeamInfo(BList* teams, uint32 flags, char* sig, BBitmap* icon,
icon(icon), icon(icon),
name(name) name(name)
{ {
for (int32 i = 0; i < kIconCacheCount; i++) _Init();
iconCache[i] = NULL;
} }
@@ -972,8 +971,7 @@ BarTeamInfo::BarTeamInfo(const BarTeamInfo &info)
icon(new BBitmap(*info.icon)), icon(new BBitmap(*info.icon)),
name(strdup(info.name)) name(strdup(info.name))
{ {
for (int32 i = 0; i < kIconCacheCount; i++) _Init();
iconCache[i] = NULL;
} }
@@ -985,3 +983,11 @@ BarTeamInfo::~BarTeamInfo()
for (int32 i = 0; i < kIconCacheCount; i++) for (int32 i = 0; i < kIconCacheCount; i++)
delete iconCache[i]; delete iconCache[i];
} }
void
BarTeamInfo::_Init()
{
for (int32 i = 0; i < kIconCacheCount; i++)
iconCache[i] = NULL;
}
+4
View File
@@ -93,6 +93,10 @@ public:
BarTeamInfo(const BarTeamInfo &info); BarTeamInfo(const BarTeamInfo &info);
~BarTeamInfo(); ~BarTeamInfo();
private:
void _Init();
public:
BList* teams; BList* teams;
uint32 flags; uint32 flags;
char* sig; char* sig;