Fix missing reference to the old group with lock still held.

Removing the team from the group may have released the last reference
to the group and freed it. Since we still have a locker on that group
it would later crash on unlock, therefore we need a reference to the
old group before removing the team from it.
This commit is contained in:
Michael Lotz
2011-12-04 20:14:24 +01:00
parent 336967aafd
commit 2872aba0a7
+1
View File
@@ -4037,6 +4037,7 @@ _user_setsid(void)
return B_NOT_ALLOWED;
// remove the team from the old and add it to the new process group
BReference<ProcessGroup> oldGroupReference(team->group);
remove_team_from_group(team);
group->Publish(session);
insert_team_into_group(group, team);