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:
@@ -35,8 +35,21 @@ class AuditLogWriterSerial : public AuditLogWriter {
|
||||
explicit AuditLogWriterSerial(AuditLog *audit)
|
||||
: AuditLogWriter(audit) { }
|
||||
|
||||
bool init() override;
|
||||
bool close() override;
|
||||
~AuditLogWriterSerial();
|
||||
|
||||
void refCountIncrease() override {
|
||||
m_refereceCount++;
|
||||
}
|
||||
|
||||
|
||||
void refCountDecreaseAndCheck() override {
|
||||
m_refereceCount--;
|
||||
if (m_refereceCount == 0) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
bool init() override;;
|
||||
bool write(Assay *assay, int parts) override;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user