summaryrefslogtreecommitdiff
path: root/SharedGraphics/GraphicsBitmap.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-31 07:02:40 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-31 07:02:40 +0100
commit2dc9c86bad76b56c4d58334a633f78a34e3500bf (patch)
treeb1c553ce27021f998af8cfbe87254ab0157519dc /SharedGraphics/GraphicsBitmap.h
parentfc0b63ca3c4af109c155c5a572afe03621b9d20e (diff)
downloadserenity-2dc9c86bad76b56c4d58334a633f78a34e3500bf.zip
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.
Diffstat (limited to 'SharedGraphics/GraphicsBitmap.h')
-rw-r--r--SharedGraphics/GraphicsBitmap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/SharedGraphics/GraphicsBitmap.h b/SharedGraphics/GraphicsBitmap.h
index a0796f92a4..de3f934ad2 100644
--- a/SharedGraphics/GraphicsBitmap.h
+++ b/SharedGraphics/GraphicsBitmap.h
@@ -43,7 +43,7 @@ private:
size_t m_pitch { 0 };
#ifdef KERNEL
- Process* m_client_process { nullptr };
+ WeakPtr<Process> m_client_process;
Region* m_client_region { nullptr };
Region* m_server_region { nullptr };
#endif