From b515ea454f02106b7f0817dafe687e498b03d875 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 15 Feb 2020 14:49:57 +0100 Subject: [PATCH] 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. --- AK/Weakable.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AK/Weakable.h b/AK/Weakable.h index 85762db437..1f09f6dd98 100644 --- a/AK/Weakable.h +++ b/AK/Weakable.h @@ -30,6 +30,8 @@ #include "RefCounted.h" #include "RefPtr.h" +#define WEAKABLE_DEBUG + namespace AK { template @@ -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> m_link; -#ifdef DEBUG +#ifdef WEAKABLE_DEBUG bool m_being_destroyed { false }; #endif };