sc/source/core/data/documen2.cxx |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 42bb97c06ec326c7e136e01bcd1a88031700b1b1
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Sat Feb 26 17:52:29 2022 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Sun Feb 27 12:19:52 2022 +0100

    Revert "Related: tdf#147448 Scope owning mutex before it gets destroyed"
    
    This reverts commit dcd042c6f28276d707af409a87a1a4380398e9b0.
    
    Reason for revert:
    Revisiting, it was wrong to put that protector in its own scope because the 
actual mutex lock is only held in its ctor and it does SetAllowRefresh(true) in 
dtor, so while it exists it prevents other refresh timers to execute.
    
    Change-Id: I058c1359c19971dba59a9273a7a8cddd77ece37f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130556
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 7aae1d338aaf454b99c7354aca78951e26043b2b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130566
    Reviewed-by: Eike Rathke <er...@redhat.com>

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 82789e814035..da55ebfa85be 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -339,11 +339,7 @@ ScDocument::~ScDocument()
     if ( pRefreshTimerControl )
     {   // To be sure there isn't anything running do it with a protector,
         // this ensures also that nothing needs the control anymore.
-        {
-            // Use a scope on its own because it is undefined behaviour if a
-            // mutex is destroyed while still owned.
-            ScRefreshTimerProtector aProt( GetRefreshTimerControlAddress() );
-        }
+        ScRefreshTimerProtector aProt( GetRefreshTimerControlAddress() );
         pRefreshTimerControl.reset();
     }
 

Reply via email to