Kaydet (Commit) 3f47ffcf authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

OModule::onFirstClient is unused

also move the MutexGuard in revokeClient. No need to hold it while doing
an osl_atomic_increment. Save it until we actually need to call
onLastClient.

Change-Id: Ia87f24b66b0430604a2fe717c95223ff1f5ece6d
Reviewed-on: https://gerrit.libreoffice.org/20919Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 693fbbfa
......@@ -75,22 +75,17 @@ namespace comphelper
void OModule::registerClient( OModule::ClientAccess )
{
::osl::MutexGuard aGuard(m_aMutex);
if ( 1 == osl_atomic_increment( &m_nClients ) )
onFirstClient();
osl_atomic_increment( &m_nClients );
}
void OModule::revokeClient( OModule::ClientAccess )
{
::osl::MutexGuard aGuard(m_aMutex);
if ( 0 == osl_atomic_decrement( &m_nClients ) )
{
::osl::MutexGuard aGuard(m_aMutex);
onLastClient();
}
void OModule::onFirstClient()
{
}
}
......
......@@ -142,11 +142,6 @@ namespace comphelper
void revokeClient( ClientAccess );
protected:
/** called when the first client has been registered
@precond
<member>m_aMutex</member> is locked
*/
virtual void onFirstClient();
/** called when the last client has been revoked
@precond
......
......@@ -57,7 +57,6 @@ namespace utl
protected:
// OModule overridables
virtual void onFirstClient() override;
virtual void onLastClient() override;
};
......
......@@ -105,11 +105,6 @@ namespace utl
return m_pImpl->getResManager();
}
void OComponentResourceModule::onFirstClient()
{
BaseClass::onFirstClient();
}
void OComponentResourceModule::onLastClient()
{
m_pImpl->freeResManager();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment