mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +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:
@@ -31,10 +31,22 @@ class AuditLogWriterParallel : public AuditLogWriter {
|
||||
explicit AuditLogWriterParallel(AuditLog *audit)
|
||||
: AuditLogWriter(audit) { }
|
||||
|
||||
~AuditLogWriterParallel() { }
|
||||
bool init() override;
|
||||
bool close() override;
|
||||
bool write(Assay *assay, int parts) override;
|
||||
|
||||
void refCountIncrease() override {
|
||||
m_refereceCount++;
|
||||
}
|
||||
|
||||
|
||||
void refCountDecreaseAndCheck() override {
|
||||
m_refereceCount--;
|
||||
if (m_refereceCount == 0) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Audit log file is saved into a directory structure. This directory
|
||||
|
Reference in New Issue
Block a user