mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel: Make Process a Weakable class.
Use this to fix a use-after-free in ~GraphicsBitmap(). We'd hit this when the WindowServer was doing a deferred destruction of a WSWindow whose backing store referred to a now-reaped Process.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <AK/Lock.h>
|
||||
|
||||
class FileDescriptor;
|
||||
@@ -45,7 +46,7 @@ struct DisplayInfo {
|
||||
byte* framebuffer;
|
||||
};
|
||||
|
||||
class Process : public InlineLinkedListNode<Process> {
|
||||
class Process : public InlineLinkedListNode<Process>, public Weakable<Process> {
|
||||
friend class InlineLinkedListNode<Process>;
|
||||
friend class WSWindowManager; // FIXME: Make a better API for allocate_region().
|
||||
friend class GraphicsBitmap; // FIXME: Make a better API for allocate_region().
|
||||
|
||||
Reference in New Issue
Block a user