mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibGfx: Make Bitmap atomic ref-counted
Fixes race condition when rendering thread runs destructor for Gfx::Bitmap owned by PaintingSurface, which was not thread-safe.
This commit is contained in:
parent
234c07adc9
commit
8f20899533
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/AtomicRefCounted.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <LibCore/AnonymousBuffer.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
|
@ -62,7 +62,7 @@ inline StorageFormat determine_storage_format(BitmapFormat format)
|
|||
|
||||
struct BackingStore;
|
||||
|
||||
class Bitmap : public RefCounted<Bitmap> {
|
||||
class Bitmap : public AtomicRefCounted<Bitmap> {
|
||||
public:
|
||||
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> create(BitmapFormat, IntSize);
|
||||
[[nodiscard]] static ErrorOr<NonnullRefPtr<Bitmap>> create(BitmapFormat, AlphaType, IntSize);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user