drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx |   26 
++++++++--
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit ce0d72fbe222d8c839d33f9e3ad56bc195e84ce0
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 19 16:21:06 2025 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Mar 19 19:01:40 2025 +0100

    fix BufferedDecompositionFlusher shutdown crash
    
    releasing the reference is not enough, we have to call stop() on it.
    
    regression from
        commit 8a17b7f0a679ebf21bcfb425186b205d996d129b
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Thu Mar 13 18:37:54 2025 +0200
        tdf#131595 Improve drawinglayer flushing mechanism.
    
    Change-Id: I6686e1fb1d2509413597ce4fa88b23d99a7e047a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183133
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx 
b/drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx
index 6bc9312a6f7f..a81b88514c9d 100644
--- a/drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx
+++ b/drawinglayer/source/primitive2d/BufferedDecompositionFlusher.cxx
@@ -38,12 +38,32 @@ namespace drawinglayer::primitive2d
     It is very simple, scales to lots and lots of primitives without needing 
lots of timers, and performs
     very little work in the common case.
 */
+namespace
+{
+class FlusherDeinit : public tools::DeleteOnDeinitBase
+{
+    rtl::Reference<BufferedDecompositionFlusher> m_xTimer;
+    virtual void doCleanup() override
+    {
+        m_xTimer->stop();
+        m_xTimer = nullptr;
+    }
+
+public:
+    FlusherDeinit()
+    {
+        m_xTimer = new BufferedDecompositionFlusher;
+        addDeinitContainer(this);
+    }
+
+    BufferedDecompositionFlusher* get() { return m_xTimer.get(); }
+};
+}
 
 static BufferedDecompositionFlusher* getInstance()
 {
-    static tools::DeleteRtlReferenceOnDeinit<BufferedDecompositionFlusher> 
gaTimer(
-        new BufferedDecompositionFlusher);
-    return gaTimer.get().get();
+    static FlusherDeinit gaTimer;
+    return gaTimer.get();
 }
 
 // static

Reply via email to