The destructor always assumed that it would be called on objects created from
ONE constructor routine. This was bogus - there is also a system provided constructor which does not allocate a pattern buffer. Make less assumptions.
This commit is contained in:
parent
dbec390e8a
commit
47d5df1d7d
@ -39,9 +39,12 @@ extern "C" {
|
||||
|
||||
Regex::~Regex()
|
||||
{
|
||||
if (buf) {
|
||||
if (buf->buffer) free(buf->buffer);
|
||||
if (buf->fastmap) free(buf->fastmap);
|
||||
delete(buf);
|
||||
}
|
||||
if (reg)
|
||||
delete(reg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user