summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/Ref.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 03:48:06 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 03:48:06 +0200
commit2eed4954c762bb8050e40798c3d9f1d3998324d1 (patch)
tree8848d4345fca4d62c23d1e7136eeff2978c9e6c5 /dev/LibCompiler/Ref.h
parent8ad58a91a11380203c4a81fe4dc93e7734631b32 (diff)
feat!(LibCompiler): Codebase and diagram has been improved.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/Ref.h')
-rw-r--r--dev/LibCompiler/Ref.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/dev/LibCompiler/Ref.h b/dev/LibCompiler/Ref.h
index c5188b5..ffc11c0 100644
--- a/dev/LibCompiler/Ref.h
+++ b/dev/LibCompiler/Ref.h
@@ -22,14 +22,15 @@ class Ref final {
~Ref() {
if (m_Strong) {
- (*m_Class).~T();
+ delete m_Class;
+ m_Class = nullptr;
}
}
LIBCOMPILER_COPY_DEFAULT(Ref);
public:
- explicit Ref(T cls, const Bool& strong = false) : m_Class(&cls), m_Strong(strong) {}
+ explicit Ref(T* cls, const Bool& strong = false) : m_Class(cls), m_Strong(strong) {}
Ref& operator=(T ref) {
*m_Class = ref;