As the comment says, deleting the cursor is not necessary.

But since every single cursor is owned by a team - why the cursor manager?
I must overlook something...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13385 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-07-01 10:13:50 +00:00
parent 3870c9f18f
commit c030c6fa68
2 changed files with 12 additions and 20 deletions

View File

@ -1,5 +1,5 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Copyright (c) 2001-2002, Haiku, Inc. // Copyright (c) 2001-2005, Haiku, Inc.
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
@ -147,25 +147,21 @@ void CursorManager::DeleteCursor(int32 token)
\brief Removes and deletes all of an application's cursors \brief Removes and deletes all of an application's cursors
\param signature Signature to which the cursors belong \param signature Signature to which the cursors belong
*/ */
void CursorManager::RemoveAppCursors(team_id team) void
CursorManager::RemoveAppCursors(team_id team)
{ {
Lock(); Lock();
int32 i=0; ServerCursor *cursor;
ServerCursor *temp=(ServerCursor*)fCursorList.ItemAt(i); int32 index = 0;
while(temp) while ((cursor = (ServerCursor*)fCursorList.ItemAt(index)) != NULL) {
{ if (cursor->OwningTeam() == team) {
if(temp && temp->OwningTeam()==team) fCursorList.RemoveItem(index);
{ delete cursor;
fCursorList.RemoveItem(i); } else
delete temp; index++;
}
else
{
i++;
}
temp=(ServerCursor*)fCursorList.ItemAt(i);
} }
Unlock(); Unlock();
} }

View File

@ -190,10 +190,6 @@ ServerApp::~ServerApp(void)
delete static_cast<ServerPicture *>(fPictureList.ItemAt(i)); delete static_cast<ServerPicture *>(fPictureList.ItemAt(i));
} }
// This shouldn't be necessary -- all cursors owned by the app
// should be cleaned up by RemoveAppCursors
// delete fAppCursor;
// although this isn't pretty, ATM we have only one RootLayer. // although this isn't pretty, ATM we have only one RootLayer.
// there should be a way that this ServerApp be attached to a particular // there should be a way that this ServerApp be attached to a particular
// RootLayer to know which RootLayer's cursor to modify. // RootLayer to know which RootLayer's cursor to modify.