BReferenceable: Always enable DEBUG in kernel mode when PARANOID_KERNEL_FREE is enabled.

This checks the reference counts are actually 0 (or 1 and allocated
on the stack). As PARANOID_KERNEL_FREE is enabled at KDEBUG_LEVEL 2,
this will thus be enabled on nightly builds.
This commit is contained in:
Augustin Cavalier
2022-02-07 15:07:37 -05:00
parent ebf0b53a7e
commit f6b6606652
+8 -1
View File
@@ -6,6 +6,13 @@
#include <Referenceable.h>
#ifdef _KERNEL_MODE
# include "kernel_debug_config.h"
# if PARANOID_KERNEL_FREE
# define DEBUG
# endif
#endif
#ifdef DEBUG
#include <stdio.h>
#endif
@@ -30,7 +37,7 @@ BReferenceable::BReferenceable()
BReferenceable::~BReferenceable()
{
#if defined(DEBUG) && !defined(_BOOT_MODE)
#if !defined(_BOOT_MODE) && defined(DEBUG)
bool enterDebugger = false;
char message[256];
if (fReferenceCount == 1) {