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:
parent
c826d194dc
commit
f3721fd1d7
|
@ -441,7 +441,6 @@ FontStyle *FontServer::GetStyle(const char *family, const char *style)
|
||||||
*/
|
*/
|
||||||
FontStyle *FontServer::GetStyle(const uint16 &familyid, const uint16 &styleid)
|
FontStyle *FontServer::GetStyle(const uint16 &familyid, const uint16 &styleid)
|
||||||
{
|
{
|
||||||
// TODO: Implement FontServer::GetStyle(id,id)
|
|
||||||
FontFamily *fam=GetFamily(familyid);
|
FontFamily *fam=GetFamily(familyid);
|
||||||
if(fam)
|
if(fam)
|
||||||
{
|
{
|
||||||
|
@ -470,12 +469,7 @@ FontFamily *FontServer::GetFamily(const uint16 &familyid) const
|
||||||
*/
|
*/
|
||||||
ServerFont *FontServer::GetSystemPlain(void)
|
ServerFont *FontServer::GetSystemPlain(void)
|
||||||
{
|
{
|
||||||
if(plain)
|
return plain;
|
||||||
{
|
|
||||||
ServerFont *f=new ServerFont(*plain);
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -486,12 +480,7 @@ ServerFont *FontServer::GetSystemPlain(void)
|
||||||
*/
|
*/
|
||||||
ServerFont *FontServer::GetSystemBold(void)
|
ServerFont *FontServer::GetSystemBold(void)
|
||||||
{
|
{
|
||||||
if(bold)
|
return bold;
|
||||||
{
|
|
||||||
ServerFont *f=new ServerFont(*bold);
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -502,12 +491,7 @@ ServerFont *FontServer::GetSystemBold(void)
|
||||||
*/
|
*/
|
||||||
ServerFont *FontServer::GetSystemFixed(void)
|
ServerFont *FontServer::GetSystemFixed(void)
|
||||||
{
|
{
|
||||||
if(fixed)
|
return fixed;
|
||||||
{
|
|
||||||
ServerFont *f=new ServerFont(*fixed);
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -1430,7 +1430,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||||
|
|
||||||
fontserver->Unlock();
|
fontserver->Unlock();
|
||||||
|
|
||||||
delete sf;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_GET_FONT_HEIGHT:
|
case AS_GET_FONT_HEIGHT:
|
||||||
|
@ -1506,7 +1505,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||||
|
|
||||||
fontserver->Unlock();
|
fontserver->Unlock();
|
||||||
|
|
||||||
delete sf;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AS_SET_SYSFONT_FIXED:
|
case AS_SET_SYSFONT_FIXED:
|
||||||
|
@ -1546,7 +1544,6 @@ void ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||||
|
|
||||||
fontserver->Unlock();
|
fontserver->Unlock();
|
||||||
|
|
||||||
delete sf;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue