summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-02-26 02:19:23 +0100
committerEike Rathke <erack@redhat.com>2022-02-26 03:11:25 +0100
commitaaa75591b0c0c7b097e2794a0b24ec7d0e0fa07f (patch)
tree5c6d77048b6127a3ff33556270ca79d904ecce21 /sc
parent4361ee2585e616cb3c504eb719deca4076de78da (diff)
Related: tdf#147448 Scope owning mutex before it gets destroyed
Change-Id: I9bacffe1d075431427fb3bf01e4bf30ba6fbc201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130574 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen2.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index da55ebfa85be..82789e814035 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -339,7 +339,11 @@ 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.
- ScRefreshTimerProtector aProt( GetRefreshTimerControlAddress() );
+ {
+ // Use a scope on its own because it is undefined behaviour if a
+ // mutex is destroyed while still owned.
+ ScRefreshTimerProtector aProt( GetRefreshTimerControlAddress() );
+ }
pRefreshTimerControl.reset();
}