diff options
Diffstat (limited to 'include/comphelper/profilezone.hxx')
-rw-r--r-- | include/comphelper/profilezone.hxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx index 2a8bb9f3dba0..aa5d41070a81 100644 --- a/include/comphelper/profilezone.hxx +++ b/include/comphelper/profilezone.hxx @@ -22,8 +22,6 @@ namespace comphelper { class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent { - static int s_nNesting; // level of nested zones. - long long m_nCreateTime; bool m_bConsole; void stopConsole(); @@ -31,7 +29,10 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent void addRecording(); - ProfileZone(const char* sName, const OUString &sArgs, bool bConsole) + static void setNestingLevel(int nNestingLevel); + static int getNestingLevel(); + + ProfileZone(const char* sName, const OUString &sArgs, bool bConsole) : NamedEvent(sName, sArgs) , m_bConsole(bConsole) , m_nNesting(-1) @@ -40,7 +41,8 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent { m_nCreateTime = getNow(); - m_nNesting = s_nNesting++; + m_nNesting = getNestingLevel(); + setNestingLevel(getNestingLevel() + 1); } else m_nCreateTime = 0; @@ -77,9 +79,9 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent { if (m_nCreateTime > 0) { - s_nNesting--; + setNestingLevel(getNestingLevel() - 1); - if (m_nNesting != s_nNesting) + if (m_nNesting != getNestingLevel()) { SAL_WARN("comphelper.traceevent", "Incorrect ProfileZone nesting for " << m_sName); } |