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.
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
{
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.
class s_number : public s_expression
{
public:
- virtual ~s_number() { }
-
bool is_number() const { return true; }
virtual float fvalue() = 0;
{
public:
s_int(int x) : val(x) { }
- virtual ~s_int() { }
bool is_int() const { return true; }
{
public:
s_float(float x) : val(x) { }
- virtual ~s_float() { }
float fvalue() { return this->val; }
{
public:
s_symbol(const char *);
- virtual ~s_symbol();
bool is_symbol() const { return true; }
{
public:
s_list();
- virtual ~s_list();
virtual bool is_list() const { return true; }
unsigned length() const;