summaryrefslogtreecommitdiffstats
path: root/vcl/unx/gtk3/gtkinst.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/gtk3/gtkinst.cxx')
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index c76d6291ce..b8da4f7b7a 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -11097,10 +11097,16 @@ private:
gtk_main_do_event(pKeyEvent);
GdkEvent *pTriggerEvent = gtk_get_current_event();
+ bool bEventOwnership = true;
if (!pTriggerEvent)
+ {
pTriggerEvent = pKeyEvent;
+ bEventOwnership = false;
+ }
gtk_menu_popup_at_widget(m_pMenu, pWidget, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, pTriggerEvent);
+ if (bEventOwnership)
+ gdk_event_free(pTriggerEvent);
gdk_event_free(pKeyEvent);
}
@@ -11118,6 +11124,7 @@ private:
{
gdk_event_get_button(pEvent, &nButton);
nTime = gdk_event_get_time(pEvent);
+ gdk_event_free(pEvent);
}
else
{
@@ -11459,8 +11466,12 @@ public:
gtk_main_do_event(pKeyEvent);
GdkEvent *pTriggerEvent = gtk_get_current_event();
+ bool bEventOwnership = true;
if (!pTriggerEvent)
+ {
pTriggerEvent = pKeyEvent;
+ bEventOwnership = false;
+ }
bool bSwapForRTL = SwapForRTL(pWidget);
@@ -11478,6 +11489,8 @@ public:
else
gtk_menu_popup_at_rect(m_pMenu, widget_get_surface(pWidget), &aRect, GDK_GRAVITY_NORTH_EAST, GDK_GRAVITY_NORTH_WEST, pTriggerEvent);
}
+ if (bEventOwnership)
+ gdk_event_free(pTriggerEvent);
gdk_event_free(pKeyEvent);
}
@@ -11500,6 +11513,7 @@ public:
if (!gdk_event_get_button(pEvent, &nButton))
nButton = 0;
nTime = gdk_event_get_time(pEvent);
+ gdk_event_free(pEvent);
}
else
{
@@ -14136,6 +14150,8 @@ private:
#if !GTK_CHECK_VERSION(4, 0, 0)
GdkEvent *pEvent = gtk_get_current_event();
m_bChangedByMouse = pEvent && categorizeEvent(pEvent) == VclInputFlags::MOUSE;
+ if (pEvent)
+ gdk_event_free(pEvent);
#else
//TODO maybe iterate over gtk_widget_observe_controllers looking for a motion controller
#endif
@@ -15500,7 +15516,10 @@ public:
GtkTreePath* end_path;
if (!gtk_tree_view_get_visible_range(m_pTreeView, &start_path, &end_path))
+ {
+ g_object_thaw_notify(G_OBJECT(m_pTreeModel));
return;
+ }
GtkInstanceTreeIter aGtkIter(nullptr);
gtk_tree_model_get_iter(m_pTreeModel, &aGtkIter.iter, start_path);
@@ -16963,6 +16982,8 @@ private:
atk_object_set_description(pChild,
OUStringToOString(sTooltipText, RTL_TEXTENCODING_UTF8).getStr());
g_object_unref(pChild);
+ gtk_tree_path_free(pPath);
+
#endif
}
@@ -20340,6 +20361,7 @@ public:
bFindButtonTextRenderer = false;
}
}
+ g_list_free(cells);
// Seeing as GtkCellRendererPixbuf no longer takes a surface, then insert our own replacement
// to render that instead here