Removes reference counter from audit_log writer

This commit is contained in:
Felipe Zimmerle 2019-01-22 12:45:56 -03:00
parent 4b88fdc513
commit f2f5c9c958
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -42,8 +42,7 @@ namespace writer {
class Writer {
public:
explicit Writer(AuditLog *audit)
: m_audit(audit),
m_refereceCount(1) { }
: m_audit(audit) { }
virtual ~Writer() { }
@ -53,23 +52,8 @@ class Writer {
static void generateBoundary(std::string *boundary);
void refCountIncrease() {
m_refereceCount++;
}
bool refCountDecreaseAndCheck() {
m_refereceCount--;
if (m_refereceCount == 0) {
delete this;
return true;
}
return false;
}
protected:
AuditLog *m_audit;
int m_refereceCount;
};