summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-24 15:32:16 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-24 17:07:28 +0000
commit1bd5e8b73d863cad6e42ea9619fc471a0dd8d14b (patch)
treeecd919372d3611261a7a8983817ea0096009a1f5 /vcl
parenta81de86c47322bd6bc59b462eb2f69e0f1185df4 (diff)
vcl: reduce maximum timeout to some sensible range.
This fixes a bug with glib, where prepare of a source with such a large (max uint64) causes precision & wrap-around problems. Add assert to avoid recurrence. Also add a helpful user-visible source name in debug mode. Change-Id: I9e1eb41af9cc49f8bff88e07f04d4bc4d1877376 Reviewed-on: https://gerrit.libreoffice.org/20152 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/gtkdata.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index d25b03652a6d..f65b4e0a7567 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -905,6 +905,9 @@ create_sal_gtk_timeout( GtkSalTimer *pTimer )
/* unused dummy */ g_idle_remove_by_data,
nullptr, nullptr );
g_source_attach( pSource, g_main_context_default() );
+#ifdef DBG_UTIL
+ g_source_set_name( pSource, "VCL timeout source" );
+#endif
sal_gtk_timeout_defer( pTSource );
@@ -937,6 +940,8 @@ bool GtkSalTimer::Expired()
void GtkSalTimer::Start( sal_uLong nMS )
{
+ // glib is not 64bit safe in this regard.
+ assert( nMS <= G_MAXINT );
m_nTimeoutMS = nMS; // for restarting
Stop(); // FIXME: ideally re-use an existing m_pTimeout
m_pTimeout = create_sal_gtk_timeout( this );