Plugged a couple memory leaks and code fix to WindowBroadcast()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7908 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -274,7 +274,7 @@ void ServerApp::WindowBroadcast(int32 code)
|
|||||||
for(int32 i=0; i<count; i++)
|
for(int32 i=0; i<count; i++)
|
||||||
{
|
{
|
||||||
ServerWindow *sw = ((WinBorder*)desktop->fWinBorderList.ItemAt(i))->Window();
|
ServerWindow *sw = ((WinBorder*)desktop->fWinBorderList.ItemAt(i))->Window();
|
||||||
BMessage msg(B_QUIT_REQUESTED);
|
BMessage msg(code);
|
||||||
sw->SendMessageToClient(&msg);
|
sw->SendMessageToClient(&msg);
|
||||||
}
|
}
|
||||||
desktop->fLayerLock.Unlock();
|
desktop->fLayerLock.Unlock();
|
||||||
@@ -297,7 +297,7 @@ void ServerApp::SendMessageToClient(const BMessage *msg) const
|
|||||||
else
|
else
|
||||||
printf("PANIC: ServerApp: '%s': can't flatten message in 'SendMessageToClient()'\n", fSignature.String());
|
printf("PANIC: ServerApp: '%s': can't flatten message in 'SendMessageToClient()'\n", fSignature.String());
|
||||||
|
|
||||||
delete buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -438,6 +438,9 @@ void ServerApp::_DispatchMessage(PortMessage *msg)
|
|||||||
}
|
}
|
||||||
case AS_UPDATE_COLORS:
|
case AS_UPDATE_COLORS:
|
||||||
{
|
{
|
||||||
|
// Eventually we will have windows which will notify their children of changes in
|
||||||
|
// system colors
|
||||||
|
|
||||||
/* STRACE(("ServerApp %s: Received global UI color update notification\n",fSignature.String()));
|
/* STRACE(("ServerApp %s: Received global UI color update notification\n",fSignature.String()));
|
||||||
ServerWindow *win;
|
ServerWindow *win;
|
||||||
BMessage msg(_COLORS_UPDATED);
|
BMessage msg(_COLORS_UPDATED);
|
||||||
@@ -454,6 +457,9 @@ void ServerApp::_DispatchMessage(PortMessage *msg)
|
|||||||
}
|
}
|
||||||
case AS_UPDATE_FONTS:
|
case AS_UPDATE_FONTS:
|
||||||
{
|
{
|
||||||
|
// Eventually we will have windows which will notify their children of changes in
|
||||||
|
// system fonts
|
||||||
|
|
||||||
/* STRACE(("ServerApp %s: Received global font update notification\n",fSignature.String()));
|
/* STRACE(("ServerApp %s: Received global font update notification\n",fSignature.String()));
|
||||||
ServerWindow *win;
|
ServerWindow *win;
|
||||||
BMessage msg(_FONTS_UPDATED);
|
BMessage msg(_FONTS_UPDATED);
|
||||||
@@ -497,16 +503,16 @@ void ServerApp::_DispatchMessage(PortMessage *msg)
|
|||||||
// 8) port_id window's message port
|
// 8) port_id window's message port
|
||||||
// 9) const char * title
|
// 9) const char * title
|
||||||
|
|
||||||
BRect frame;
|
BRect frame;
|
||||||
uint32 look;
|
uint32 look;
|
||||||
uint32 feel;
|
uint32 feel;
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
uint32 wkspaces;
|
uint32 wkspaces;
|
||||||
int32 token;
|
int32 token;
|
||||||
port_id sendPort;
|
port_id sendPort;
|
||||||
port_id looperPort;
|
port_id looperPort;
|
||||||
port_id replyport;
|
port_id replyport;
|
||||||
char *title;
|
char *title;
|
||||||
|
|
||||||
msg->Read<BRect>(&frame);
|
msg->Read<BRect>(&frame);
|
||||||
msg->Read<int32>((int32*)&look);
|
msg->Read<int32>((int32*)&look);
|
||||||
@@ -522,15 +528,15 @@ void ServerApp::_DispatchMessage(PortMessage *msg)
|
|||||||
STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",fSignature.String()));
|
STRACE(("ServerApp %s: Got 'New Window' message, trying to do smething...\n",fSignature.String()));
|
||||||
|
|
||||||
// ServerWindow constructor will reply with port_id of a newly created port
|
// ServerWindow constructor will reply with port_id of a newly created port
|
||||||
ServerWindow *sw = NULL;
|
ServerWindow *sw = NULL;
|
||||||
sw = new ServerWindow(frame, title, look, feel, flags, this,
|
sw = new ServerWindow(frame, title, look, feel, flags, this,
|
||||||
sendPort, looperPort, replyport, wkspaces, token);
|
sendPort, looperPort, replyport, wkspaces, token);
|
||||||
sw->Init();
|
sw->Init();
|
||||||
|
|
||||||
STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
STRACE(("\nServerApp %s: New Window %s (%.1f,%.1f,%.1f,%.1f)\n",
|
||||||
fSignature.String(),title,frame.left,frame.top,frame.right,frame.bottom));
|
fSignature.String(),title,frame.left,frame.top,frame.right,frame.bottom));
|
||||||
|
|
||||||
delete title;
|
delete [] title;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user