Properly deal with classes destructors

There are some classes such as AuditLog that demands a reference count. That is
needed because this class can be used by different instances of the Rules
classes.
This commit is contained in:
Felipe Zimmerle
2015-07-13 12:28:25 -03:00
parent 0c98bdc80b
commit 001d5ebf7f
13 changed files with 100 additions and 18 deletions

View File

@@ -32,9 +32,14 @@ class AuditLog;
class AuditLogWriter {
public:
explicit AuditLogWriter(AuditLog *audit)
: m_audit(audit) { }
: m_audit(audit),
m_refereceCount(1) { }
~AuditLogWriter() { }
virtual void refCountIncrease() = 0;
virtual void refCountDecreaseAndCheck() = 0;
virtual bool close() { return true; }
virtual bool init() { return true; }
virtual bool write(Assay *assay, int parts);
@@ -42,6 +47,7 @@ class AuditLogWriter {
protected:
AuditLog *m_audit;
int m_refereceCount;
};
} // namespace ModSecurity