mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:57:45 +00:00
AK+Kernel: Disallow implicitly lifting pointers to OwnPtr's
This doesn't really _fix_ anything, it just gets rid of the API and instead makes the users explicitly use `adopt_own_if_non_null()`.
This commit is contained in:
parent
3bc2527ce7
commit
2b5732ab77
6 changed files with 27 additions and 20 deletions
|
@ -576,7 +576,7 @@ KResult Plan9FS::read_and_dispatch_one_message()
|
|||
auto completion = optional_completion.value();
|
||||
ScopedSpinLock lock(completion->lock);
|
||||
completion->result = KSuccess;
|
||||
completion->message = new Message { buffer.release_nonnull() };
|
||||
completion->message = adopt_own_if_nonnull(new Message { buffer.release_nonnull() });
|
||||
completion->completed = true;
|
||||
|
||||
m_completions.remove(header.tag);
|
||||
|
|
|
@ -1102,7 +1102,7 @@ KResult ProcFSInode::refresh_data(FileDescription& description) const
|
|||
}
|
||||
|
||||
if (!cached_data)
|
||||
cached_data = new ProcFSInodeData;
|
||||
cached_data = adopt_own_if_nonnull(new ProcFSInodeData);
|
||||
auto& buffer = static_cast<ProcFSInodeData&>(*cached_data).buffer;
|
||||
if (buffer) {
|
||||
// If we're reusing the buffer, reset the size to 0 first. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue