add missing operator=; fixes a crash that only occurs after releasing snapshots

This commit is contained in:
Glenn Maynard
2003-03-28 05:23:35 +00:00
parent c7c02602d9
commit 8db1c70e1e
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -678,6 +678,7 @@ void Regex::Release()
{
delete (regex_t *)reg;
reg = NULL;
pattern = "";
}
Regex::Regex(const CString &str)
@@ -689,8 +690,13 @@ Regex::Regex(const CString &str)
Regex::Regex(const Regex &rhs)
{
reg = NULL;
pattern=rhs.pattern;
Compile();
Set(rhs.pattern);
}
Regex &Regex::operator=(const Regex &rhs)
{
if(this != &rhs) Set(rhs.pattern);
return *this;
}
Regex::~Regex()
+1
View File
@@ -209,6 +209,7 @@ class Regex {
public:
Regex(const CString &pat = "");
Regex(const Regex &rhs);
Regex &operator=(const Regex &rhs);
~Regex();
void Set(const CString &str);
bool Compare(const CString &str);