mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09: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
Notes:
github-actions[bot]
2025-04-24 01:13:17 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 8f20899533
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4443
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue