Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <shamser.ahmed@lexisnexis.com>
  • Loading branch information
shamser committed May 22, 2024
1 parent cd8ecf6 commit e38e86b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dali/base/sysinfologger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ class CSysInfoLoggerMsgIterator : public CInterface, implements ISysInfoLoggerMs
CSysInfoLoggerMsgIterator(ISysInfoLoggerMsgFilter * _filter, bool _updateable=false) : filter(_filter), updateable(_updateable)
{
}
~CSysInfoLoggerMsgIterator()
{
if (conn)
{
conn->close();
conn.clear();
}
}
CSysInfoLoggerMsg & queryInfoLoggerMsg()
{
return infoMsg.set(msgIter->get(), *(root.get()), updateable);
Expand All @@ -429,7 +437,7 @@ class CSysInfoLoggerMsgIterator : public CInterface, implements ISysInfoLoggerMs
if (filter->queryMatchDay())
xpath.appendf("/d%02u", filter->queryMatchDay());
}
unsigned mode = RTM_LOCK_READ | (updateable?RTM_LOCK_WRITE : 0);
unsigned mode = updateable ? RTM_LOCK_WRITE : RTM_LOCK_READ;
conn.setown(querySDS().connect(xpath.str(), myProcessSession(), mode, SDS_LOCK_TIMEOUT));
if (!conn)
return false;
Expand Down Expand Up @@ -605,10 +613,11 @@ unsigned deleteOlderThanLogSysInfoMsg(bool visibleOnly, bool hiddenOnly, unsigne
}
}
}
conn->close();
return count;
}

#ifdef DISABLE_USE_CPPUNIT
#ifdef _USE_CPPUNIT
#include "unittests.hpp"

#define SOURCE_CPPUNIT "cppunit"
Expand Down

0 comments on commit e38e86b

Please sign in to comment.