mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
Kernel: Use try_make_weak_ptr() instead of make_weak_ptr()
This commit is contained in:
parent
98c20b65cc
commit
c8ab7bde3b
7 changed files with 19 additions and 18 deletions
|
@ -724,9 +724,9 @@ public:
|
|||
|
||||
class ProcessProcFSTraits : public ProcFSExposedComponent {
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, Process& process)
|
||||
static ErrorOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, WeakPtr<Process> process)
|
||||
{
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) ProcessProcFSTraits(process));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) ProcessProcFSTraits(move(process)));
|
||||
}
|
||||
|
||||
virtual InodeIndex component_index() const override;
|
||||
|
@ -738,8 +738,8 @@ public:
|
|||
virtual GroupID owner_group() const override;
|
||||
|
||||
private:
|
||||
explicit ProcessProcFSTraits(Process& process)
|
||||
: m_process(process.make_weak_ptr())
|
||||
explicit ProcessProcFSTraits(WeakPtr<Process> process)
|
||||
: m_process(move(process))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue