mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
Kernel: Customize File::unref() and make it virtual
Make File inherit from RefCountedBase and provide a custom unref() implementation. This will allow subclasses that participate in lists to remove themselves in a safe way when being destroyed.
This commit is contained in:
parent
fc0cd8317a
commit
641083f3b8
2 changed files with 10 additions and 1 deletions
|
@ -71,9 +71,10 @@ public:
|
|||
// - Should create a Region in the Process and return it if successful.
|
||||
|
||||
class File
|
||||
: public RefCounted<File>
|
||||
: public RefCountedBase
|
||||
, public Weakable<File> {
|
||||
public:
|
||||
virtual bool unref() const;
|
||||
virtual ~File();
|
||||
|
||||
virtual KResultOr<NonnullRefPtr<FileDescription>> open(int options);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue