Tweaked the GetSystem font calls to prevent memory leaks

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11184 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2005-02-01 23:23:45 +00:00
parent c826d194dc
commit f3721fd1d7
2 changed files with 3 additions and 22 deletions

View File

@ -441,7 +441,6 @@ FontStyle *FontServer::GetStyle(const char *family, const char *style)
*/
FontStyle *FontServer::GetStyle(const uint16 &familyid, const uint16 &styleid)
{
// TODO: Implement FontServer::GetStyle(id,id)
FontFamily *fam=GetFamily(familyid);
if(fam)
{
@ -470,12 +469,7 @@ FontFamily *FontServer::GetFamily(const uint16 &familyid) const
*/
ServerFont *FontServer::GetSystemPlain(void)
{
if(plain)
{
ServerFont *f=new ServerFont(*plain);
return f;
}
return NULL;
return plain;
}
/*!
@ -486,12 +480,7 @@ ServerFont *FontServer::GetSystemPlain(void)
*/
ServerFont *FontServer::GetSystemBold(void)
{
if(bold)
{
ServerFont *f=new ServerFont(*bold);
return f;
}
return NULL;
return bold;
}
/*!
@ -502,12 +491,7 @@ ServerFont *FontServer::GetSystemBold(void)
*/
ServerFont *FontServer::GetSystemFixed(void)
{
if(fixed)
{
ServerFont *f=new ServerFont(*fixed);
return f;
}
return NULL;
return fixed;
}
/*!

View File

@ -1430,7 +1430,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
fontserver->Unlock();
delete sf;
break;
}
case AS_GET_FONT_HEIGHT:
@ -1506,7 +1505,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
fontserver->Unlock();
delete sf;
break;
}
case AS_SET_SYSFONT_FIXED:
@ -1546,7 +1544,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
fontserver->Unlock();
delete sf;
break;
}
default: