1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:58:12 +00:00

Kernel: Make ProcessGroup::find_or_create API OOM safe

Make ProcessGroup::find_or_create & ProcessGroup::create OOM safe, by
moving to adopt_ref_if_nonnull.
This commit is contained in:
Brian Gianforcaro 2021-05-18 02:07:25 -07:00 committed by Andreas Kling
parent 7540f4268b
commit bb91bed576
3 changed files with 9 additions and 6 deletions

View file

@ -28,8 +28,8 @@ class ProcessGroup
public:
~ProcessGroup();
static NonnullRefPtr<ProcessGroup> create(ProcessGroupID);
static NonnullRefPtr<ProcessGroup> find_or_create(ProcessGroupID);
static RefPtr<ProcessGroup> create(ProcessGroupID);
static RefPtr<ProcessGroup> find_or_create(ProcessGroupID);
static RefPtr<ProcessGroup> from_pgid(ProcessGroupID);
const ProcessGroupID& pgid() const { return m_pgid; }