diff --git a/src/servers/app/CursorManager.cpp b/src/servers/app/CursorManager.cpp index 979f7b857f..6589dfbe71 100644 --- a/src/servers/app/CursorManager.cpp +++ b/src/servers/app/CursorManager.cpp @@ -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 // 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 \param signature Signature to which the cursors belong */ -void CursorManager::RemoveAppCursors(team_id team) +void +CursorManager::RemoveAppCursors(team_id team) { Lock(); - int32 i=0; - ServerCursor *temp=(ServerCursor*)fCursorList.ItemAt(i); - while(temp) - { - if(temp && temp->OwningTeam()==team) - { - fCursorList.RemoveItem(i); - delete temp; - } - else - { - i++; - } - temp=(ServerCursor*)fCursorList.ItemAt(i); + ServerCursor *cursor; + int32 index = 0; + while ((cursor = (ServerCursor*)fCursorList.ItemAt(index)) != NULL) { + if (cursor->OwningTeam() == team) { + fCursorList.RemoveItem(index); + delete cursor; + } else + index++; } + Unlock(); } diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index ab2bec9602..10161907bc 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -190,10 +190,6 @@ ServerApp::~ServerApp(void) delete static_cast(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. // there should be a way that this ServerApp be attached to a particular // RootLayer to know which RootLayer's cursor to modify.