summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Worth <[email protected]>2010-06-23 16:27:18 -0700
committerCarl Worth <[email protected]>2010-06-23 16:38:05 -0700
commit015b3a5115df9a53b73d4b99fed86cf245c87aca (patch)
treea1706731b6508e2d8a1d56711d86a6c72b2b1928
parentf961e4458f1e894ca782c1627b69cdee993a16f8 (diff)
exec_node: Remove destructor from exec_node and all descendants.
Two of these destructors are non-empty, (s_symbol and s_list), so this commit could potentially introduce memory leaks, (though, no additional leaks are found in glsl-orangebook-ch06-bump.frag at least---perhaps the current code is never calling delete on these classes?). Going forward, we will switch to talloc for exec_node so we won't need explicit destrcutors to free up any memory used.
-rw-r--r--s_expression.cpp15
-rw-r--r--s_expression.h8
2 files changed, 0 insertions, 23 deletions
diff --git a/s_expression.cpp b/s_expression.cpp
index 4022dfab7a7..0fb296ef671 100644
--- a/s_expression.cpp
+++ b/s_expression.cpp
@@ -34,25 +34,10 @@ s_symbol::s_symbol(const char *tmp)
strcpy(this->str, tmp);
}
-s_symbol::~s_symbol()
-{
- delete [] this->str;
- this->str = NULL;
-}
-
s_list::s_list()
{
}
-s_list::~s_list()
-{
- exec_list_iterator it(this->subexpressions.iterator());
- while (it.has_next())
- it.remove();
-
- assert(this->subexpressions.is_empty());
-}
-
unsigned
s_list::length() const
{
diff --git a/s_expression.h b/s_expression.h
index d5e52c16e83..8a4eda28dae 100644
--- a/s_expression.h
+++ b/s_expression.h
@@ -46,8 +46,6 @@
class s_expression : public exec_node
{
public:
- virtual ~s_expression() { }
-
/**
* Read an S-Expression from the given string.
* Advances the supplied pointer to just after the expression read.
@@ -73,8 +71,6 @@ protected:
class s_number : public s_expression
{
public:
- virtual ~s_number() { }
-
bool is_number() const { return true; }
virtual float fvalue() = 0;
@@ -87,7 +83,6 @@ class s_int : public s_number
{
public:
s_int(int x) : val(x) { }
- virtual ~s_int() { }
bool is_int() const { return true; }
@@ -104,7 +99,6 @@ class s_float : public s_number
{
public:
s_float(float x) : val(x) { }
- virtual ~s_float() { }
float fvalue() { return this->val; }
@@ -118,7 +112,6 @@ class s_symbol : public s_expression
{
public:
s_symbol(const char *);
- virtual ~s_symbol();
bool is_symbol() const { return true; }
@@ -135,7 +128,6 @@ class s_list : public s_expression
{
public:
s_list();
- virtual ~s_list();
virtual bool is_list() const { return true; }
unsigned length() const;