diff --git a/src/apps/processcontroller/MemoryBarMenu.cpp b/src/apps/processcontroller/MemoryBarMenu.cpp index 52c561fea9..0aa5b4f146 100644 --- a/src/apps/processcontroller/MemoryBarMenu.cpp +++ b/src/apps/processcontroller/MemoryBarMenu.cpp @@ -134,7 +134,6 @@ MemoryBarMenu::Pulse() fTeamList[j] = infos.team_info.team; if (!get_team_name_and_icon(infos, true)) { // the team is already gone! - delete infos.team_icon; fTeamList[j] = -1; } else { if (!item && firstRecycle < lastRecycle) diff --git a/src/apps/processcontroller/QuitMenu.cpp b/src/apps/processcontroller/QuitMenu.cpp index ee4192dc98..369bbab0db 100644 --- a/src/apps/processcontroller/QuitMenu.cpp +++ b/src/apps/processcontroller/QuitMenu.cpp @@ -106,9 +106,10 @@ QuitMenu::AddTeam(team_id tmid) else { info_pack infos; if (get_team_info(tmid, &infos.team_info) == B_OK - && get_team_name_and_icon(infos, true)) + && get_team_name_and_icon(infos, true)) { item = new QuitMenuItem(tmid, infos.team_icon, infos.team_name, message, true); + } } if (item) { item->SetTarget(gPCView); diff --git a/src/apps/processcontroller/TeamBarMenu.cpp b/src/apps/processcontroller/TeamBarMenu.cpp index f65ef1926e..aecfe36871 100644 --- a/src/apps/processcontroller/TeamBarMenu.cpp +++ b/src/apps/processcontroller/TeamBarMenu.cpp @@ -117,7 +117,6 @@ TeamBarMenu::Pulse() fTeamList[j] = infos.team_info.team; if (!get_team_name_and_icon(infos, true)) { // the team is already gone! - delete infos.team_icon; fTeamList[j] = -1; } else { if (!item && firstRecycle < lastRecycle) { diff --git a/src/apps/processcontroller/Utilities.cpp b/src/apps/processcontroller/Utilities.cpp index 60fef30179..470247b3b3 100644 --- a/src/apps/processcontroller/Utilities.cpp +++ b/src/apps/processcontroller/Utilities.cpp @@ -67,6 +67,12 @@ get_team_name_and_icon(info_pack& infoPack, bool icon) B_MINI_ICON) != B_OK) { BMimeType genericAppType(B_APP_MIME_TYPE); status = genericAppType.GetIcon(infoPack.team_icon, B_MINI_ICON); + // failed to get icon + if (status != B_OK) { + delete infoPack.team_icon; + infoPack.team_icon = NULL; + return false; + } } } else infoPack.team_icon = NULL;