summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-24 11:16:19 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-24 11:16:19 +0800
commitbe1a8b9e0464551a61d9f216c67b0542b33559b0 (patch)
treed1a5a5db0c00bd122db770085a3be20558df6f51
parent2eafb97e4b6e5187c14fce045aa1c956caaecbd7 (diff)
downloadmrust-be1a8b9e0464551a61d9f216c67b0542b33559b0.tar.gz
MIR Ptr - Implement destructor
-rw-r--r--src/mir/mir_ptr.cpp9
1 files changed, 9 insertions, 0 deletions
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;
+ }
}