add missing operator=; fixes a crash that only occurs after releasing snapshots
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user