mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Make sure that Weakable always has the same memory layout
Weakable objects ended up with differing memory layouts in some ports since they don't build with the DEBUG macro defined. Instead of forcing ports to define DEBUG, just put this behind a custom WEAKABLE_DEBUG macro and leave it always-on for now.
This commit is contained in:
parent
d5e167e725
commit
b515ea454f
Notes:
sideshowbarker
2024-07-19 09:18:53 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b515ea454f0
1 changed files with 4 additions and 2 deletions
|
@ -30,6 +30,8 @@
|
|||
#include "RefCounted.h"
|
||||
#include "RefPtr.h"
|
||||
|
||||
#define WEAKABLE_DEBUG
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
|
@ -66,7 +68,7 @@ protected:
|
|||
|
||||
~Weakable()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#ifdef WEAKABLE_DEBUG
|
||||
m_being_destroyed = true;
|
||||
#endif
|
||||
if (m_link)
|
||||
|
@ -75,7 +77,7 @@ protected:
|
|||
|
||||
private:
|
||||
RefPtr<WeakLink<T>> m_link;
|
||||
#ifdef DEBUG
|
||||
#ifdef WEAKABLE_DEBUG
|
||||
bool m_being_destroyed { false };
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue