[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 17 11:03:11 UTC 2021


 vcl/unx/gtk3/customcellrenderer.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 370577a641b77b6cf0a08fa73a1ae62fd0bea15b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 17 10:24:06 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 17 13:02:38 2021 +0200

    gtk4: guard vcl calls from gtk
    
    Change-Id: Iff35ff96c5df987258979b388485af4f3d1f039e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122240
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/customcellrenderer.cxx b/vcl/unx/gtk3/customcellrenderer.cxx
index c43638648dc6..94d6a01f2cee 100644
--- a/vcl/unx/gtk3/customcellrenderer.cxx
+++ b/vcl/unx/gtk3/customcellrenderer.cxx
@@ -30,7 +30,11 @@ G_DEFINE_TYPE(CustomCellRenderer, custom_cell_renderer, GTK_TYPE_CELL_RENDERER_T
 
 static void custom_cell_renderer_init(CustomCellRenderer* self)
 {
-    new (&self->device) VclPtr<VirtualDevice>;
+    {
+        SolarMutexGuard aGuard;
+        new (&self->device) VclPtr<VirtualDevice>;
+    }
+
     // prevent loplugin:unreffun firing on macro generated function
     (void)custom_cell_renderer_get_instance_private(self);
 }
@@ -96,8 +100,12 @@ static void custom_cell_renderer_finalize(GObject* object)
     CustomCellRenderer* cellsurface = CUSTOM_CELL_RENDERER(object);
 
     g_free(cellsurface->id);
-    cellsurface->device.disposeAndClear();
-    cellsurface->device.~VclPtr<VirtualDevice>();
+
+    {
+        SolarMutexGuard aGuard;
+        cellsurface->device.disposeAndClear();
+        cellsurface->device.~VclPtr<VirtualDevice>();
+    }
 
     G_OBJECT_CLASS(custom_cell_renderer_parent_class)->finalize(object);
 }


More information about the Libreoffice-commits mailing list