[Libreoffice] suspect code in extentions/sdext/source/presenter/PresenterClock.cxx

Norbert Thiebaud nthiebaud at gmail.com
Sun Oct 31 21:04:56 PDT 2010


the followinf code seems suspect to me:


//----- XPaintListener --------------------------------------------------------

void SAL_CALL PresenterClock::windowPaint (const awt::PaintEvent& rEvent)
    throw (RuntimeException)
{
    (void)rEvent;
    ThrowIfDisposed();
    ::osl::MutexGuard aSolarGuard (::osl::Mutex::getGlobalMutex());
    Paint(rEvent.UpdateRect);
}

getGlobalMutex() is not the solarmutex. this is a mutex instanciated
by the osl library.
The fact that the guard is named SoalrGuard, lead me to believe that
the original author meant to take a guard on the solarMutex.

I'm thinking I should change this guard with a SolarMutexGuard aSolarGuard;

Someone has an opinion on this ?

Note: similar code exist in PresentedNotesView.cxx and PresenterTimer.cxx

Norbert


More information about the LibreOffice mailing list