From be1a8b9e0464551a61d9f216c67b0542b33559b0 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 24 Oct 2016 11:16:19 +0800 Subject: MIR Ptr - Implement destructor --- src/mir/mir_ptr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/mir/mir_ptr.cpp b/src/mir/mir_ptr.cpp index a31e12ab..f7d08ac9 100644 --- a/src/mir/mir_ptr.cpp +++ b/src/mir/mir_ptr.cpp @@ -1,9 +1,18 @@ /* + * MRustC - Rust Compiler + * - By John Hodge (Mutabah/thePowersGang) + * + * mir/mir_ptr.cpp + * - Destructor for MIR function pointers (cold path code) */ #include "mir_ptr.hpp" +#include "mir.hpp" ::MIR::FunctionPointer::~FunctionPointer() { + if( this->ptr ) { + delete this->ptr, this->ptr = nullptr; + } } -- cgit v1.2.3