diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 00a7da17e6..b794b07b30 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -4028,6 +4028,7 @@ _user_setsid(void) // lock the team's current process group, parent, and the team itself team->LockTeamParentAndProcessGroup(); + BReference oldGroupReference(team->group); AutoLocker oldGroupLocker(team->group, true); TeamLocker parentLocker(team->parent, true); TeamLocker teamLocker(team, true); @@ -4037,7 +4038,6 @@ _user_setsid(void) return B_NOT_ALLOWED; // remove the team from the old and add it to the new process group - BReference oldGroupReference(team->group); remove_team_from_group(team); group->Publish(session); insert_team_into_group(group, team);