summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-01-13 15:38:28 +0100
committerAndras Timar <andras.timar@collabora.com>2024-01-15 16:27:14 +0100
commitb66c6aa88484ebe8a6b013bf5990c6be45e48892 (patch)
tree1227d02055e99b116f540bfb33ee5121829b08ff /vcl
parentc2766f242f21988566085d4c21b4e8e4ec8f435d (diff)
Add missing gdk_event_free (vcl/gtkinst)
Change-Id: I8bef4c3303f8f2fd89c1cf7cec35536c38d9d4d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162001 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 1dafaa04d595..8bdeb8621549 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