mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user