diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:36:11 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-29 10:36:11 +0200 |
| commit | 385210cacb86008a65d060a5d21b9a2451e9c076 (patch) | |
| tree | ab179489ac35784fb008969cc20a6f82756ed353 /dev/kernel/NeKit/Ref.h | |
| parent | 3a24657f3602bf5a6a9ec0dc8e208b68cea76a2a (diff) | |
fix: Fix Ref class, which caused memory leaks on the kernel.0.0.2e3
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/NeKit/Ref.h')
| -rw-r--r-- | dev/kernel/NeKit/Ref.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/dev/kernel/NeKit/Ref.h b/dev/kernel/NeKit/Ref.h index 80494ab8..9920aa6f 100644 --- a/dev/kernel/NeKit/Ref.h +++ b/dev/kernel/NeKit/Ref.h @@ -25,11 +25,9 @@ class Ref final { public: Ref(T* cls) : fClass(cls) {} - Ref(T cls) : fClass(nullptr) { fClass = new T(cls); } + Ref(T cls) : fClass(nullptr) { fClass = &cls; } Ref& operator=(T ref) { - if (!fClass) return *this; - fClass = &ref; return *this; } |
