Commit Graph

6078 Commits

Author SHA1 Message Date
Colin Walters
649faee0e6 gio/gnetworkmonitornetlink.c: Add NULL check on dest before using it 2019-08-24 15:55:49 +02:00
Colin Walters
f731dd376c gio/glib-compile-resources.c: Unref objects in error path 2019-08-24 15:44:59 +02:00
Philip Withnall
84738f7e80 Merge branch 'wip/hadess/gnetworkmonitor-nm-fixups' into 'master'
gnetworkmonitornm fixups

See merge request GNOME/glib!1016
2019-07-29 15:47:55 +00:00
Bastien Nocera
f299886f1f gnetworkmonitornm: Remove double-space 2019-07-29 17:28:01 +02:00
Bastien Nocera
109f247039 gnetworkmonitornm: Arguments to g-signal's callback are const 2019-07-29 17:28:01 +02:00
Bastien Nocera
7d3ecce346 gnetworkmonitornm: Disconnect g-signal from proxy
So that we're sure never to receive a signal if something is keeping the
proxy alive.
2019-07-29 17:28:01 +02:00
Bastien Nocera
ef1d5b5ee0 gnetworkmonitornm: Remove unneeded ";" in G_DEFINE_INTERFACE_WITH_CODE 2019-07-29 17:28:01 +02:00
Philip Withnall
86ba1b37bd Merge branch 'application-free-remote-actions' into 'master'
gapplication: Fix a leaking GRemoteActionGroup member

See merge request GNOME/glib!1011
2019-07-29 13:21:51 +00:00
Philip Withnall
96c74fd0e6 win32: Stop using deprecated GTimeVal in GWinHttpFile
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
de25be72f0 tests: Stop using deprecated g_get_current_time()
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
161654681f gfileinfo: Stop using deprecated GTimeVal
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
def5db23a3 gdbusutils: Stop using g_get_current_time()
It is deprecated.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
4faf4fcfaa gfileinfo: Deprecate g_file_info_{get,set}_modification_time()
They use the deprecated GTimeVal type, which is not year 2038 safe, so
have to be deprecated.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
d166a55c64 gfileinfo: Add g_file_info_{get,set}_modification_date_time() APIs
These are alternatives to g_file_info_{get,set}_modification_time(),
which will soon be deprecated due to using the deprecated GTimeVal
type, which is not year 2038 safe.

The new APIs take a GDateTime instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1438
2019-07-29 12:27:29 +01:00
Philip Withnall
8f385b8cf5 Merge branch 'master' into 'master'
windows: fix multicast socket binding to specific network interfaces

Closes #1635

See merge request GNOME/glib!887
2019-07-29 11:10:40 +00:00
Philip Withnall
0f131857ba gapplication: Fix a leaking GRemoteActionGroup member
Fix prompted by Ting-Wei Lan’s similar fix for the inactivity timeout
(!1009).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-29 10:49:45 +01:00
Ting-Wei Lan
0ed8605079 gapplication: remove inactivity_timeout source on finalize
The event source used to handle inactivity_timeout doesn't hold a
reference on the application. Therefore, it is possible for callback
function of the event source to run after the application has been
freed, leading to use-after-free problem. To avoid the problem, we
should remove the event source before the application is freed.

This should fix SIGBUS crash of gio/tests/gapplication on FreeBSD.
https://gitlab.gnome.org/GNOME/glib/issues/1846#note_566550
2019-07-27 15:28:23 +08:00
Philip Withnall
78b1278d44 Merge branch '488-assert-gobjects-dont-leak' into 'master'
gobject: Add a g_assert_finalize_object() macro

Closes #1780 and #488

See merge request GNOME/glib!859
2019-07-25 15:42:39 +00:00
Philip Withnall
b6d4da7684 tests: Use g_object_assert_last_unref() in various tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-07-25 15:23:21 +01:00
Emmanuele Bassi
17be9e5c4c Merge branch '436-test-coredumps' into 'master'
Fix tests creating coredumps

Closes #436

See merge request GNOME/glib!959
2019-07-25 13:49:09 +00:00
Emmanuele Bassi
298ee8f87c Merge branch '1791-macos-get-mime-dirs' into 'master'
gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS

Closes #1791

See merge request GNOME/glib!927
2019-07-25 13:48:04 +00:00
Philip Withnall
3de1b88339 gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS
These are here to prevent linker errors, since `gcontenttype.[ch]`
aren’t compiled on Windows or macOS.

The implementations are stubs to be filled out by someone who knows each
platform, at some point in the future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1791
2019-07-24 14:50:53 +01:00
Emmanuele Bassi
00d7568e4f build: Remove unsupported install directives
We're using the `install` argument for configure_file() all over the
place.

The support for an `install` argument for configure_file() was added in
Meson 0.50, but we haven't bumped the minimum version of Meson we
require, yet; which means we're getting compatibility warnings when
using recent versions of Meson, and undefined behaviour when using older
versions.

The configure_file() object defaults to `install: false`, unless an
install directory is used. This means that all instances of an `install`
argument with an explicit `true` or `false` value can be removed,
whereas all instances of `install` with a value determined from a
configuration option must be turned into an explicit conditional.
2019-07-24 12:45:02 +01:00
Simon McVittie
3f1a79a4fa Merge branch 'allow_guid_key_in_dbus_addresses' into 'master'
Allow guid key in dbus addresses

Closes #1018

See merge request GNOME/glib!995
2019-07-23 13:01:09 +00:00
Дилян Палаузов
74583affe0 Add (out) annotation to (optional) parameters
… as the parameters are not (inout).

Closes #1837
2019-07-23 11:41:42 +00:00
Philip Withnall
249299a76f Merge branch 'doc-fixes' into 'master'
Various doc fixes

See merge request GNOME/glib!982
2019-07-17 10:58:21 +00:00
Philip Withnall
fa4423d435 Merge branch 'clang-cl-support' into 'master'
Experimental clang-cl support

See merge request GNOME/glib!979
2019-07-17 10:30:28 +00:00
Matthew Leeds
0c495f3dbf gdbusaddress: Add missing transfer annotation 2019-07-16 13:43:20 -07:00
Emmanuel Fleury
6a1512ed65 Allow guid key in dbus addresses
Original patch from William Hua

Fix issue #1018
2019-07-16 10:34:42 +02:00
Matthew Leeds
ce9ea30b1d gio: Fix minor docs mistakes 2019-07-15 16:07:18 -07:00
Philip Withnall
2ac44f3111 Merge branch 'key-file-no-file' into 'master'
key file: Handle filename being NULL

Closes #1825

See merge request GNOME/glib!984
2019-07-15 12:50:45 +00:00
Philip Withnall
493b8ca021 Merge branch 'keyfile-portal-fixes' into 'master'
Keyfile portal fixes

See merge request GNOME/glib!985
2019-07-15 12:32:01 +00:00
Matthias Clasen
addb8c158a settings: Tweak priorities for keyfile backend
We want to use the keyfile backend in sandboxes,
but we want to avoid people losing their existing
settings that are stored in dconf. Flatpak does
a migration from dconf to keyfile, but only if
the app explictly requests it.

From an app perspective, there are two steps to
the dconf->keyfile migration:
1. Request that flatpak do the migration, by adding
   the migrate-path key to the metadata
2. Stop adding the 'dconf hole' to the sandbox

To keep us from switching to the keyfile backend
prematurely, look at whether the app has stopped
requesting a 'dconf hole' in the sandbox.
2019-07-15 13:01:56 +01:00
Matthias Clasen
9c5d3a6081 portal: Add a getter for dconf access
Add method to find whether the sandbox provides
access to dconf. This will be used to tweak
the priorities for the keyfile settings backend.
2019-07-15 13:01:56 +01:00
DDoSolitary
2718245dc2 Fix test failures for static builds
The plugin modules in these tests get statically linked with a separate
copy of GLib so they end up calling vfuncs in their own copy of GLib.

Fixes #1648
2019-07-15 11:01:04 +00:00
Nirbheek Chauhan
5e7f12b0ce gio/tests: Remove code and comments referring to libtool 2019-07-13 12:23:07 +05:30
Riccardo Bortolato
2b1a9219f1 windows: fix multicast socket binding to specific network interfaces
v7, based on a patch by mrgard (GNOME/glib#1635)
make w32_adapter_ipv4_addr() C90-compliant
check for ERROR_BUFFER_OVERFLOW when calling GetAdaptersAddresses()
code-style fixes
indentation fixes
use g_try_(re)alloc and g_free
style suggestions by pwithnall
drop uni_count variable
cap maximum allowed interface name string length according to windows documentation

Fixes: #1635
2019-07-12 15:21:53 +02:00
Chun-wei Fan
e8d471f3e1 meson: Mostly assume clang-cl is MSVC
We need to enable building the dirent and gnulib sources for clang-cl,
as we are still using the Microsoft-style headers and lib's and CRT.
We need to also do this for the following, for similar reasoning:

-Symbol export (via __declspec(dllexport))
-Dependency discovery without pkg-config files
-long long and ssize_t detection

We do, however, enable the autoptr tests for clang-cl builds.  Note that
at this point real MSVC builds are still better supported than clang-cl
builds, and it will likely remain so for at least the near future,
alhtough real MSVC builds of the GTK stack are consumable and are usable
by clang-cl.
2019-07-11 15:38:21 +08:00
Matthias Clasen
953f23f13c key file: Handle filename being NULL
This happens when we are default-constructed
without explicit arguments.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1825
2019-07-10 11:14:03 -04:00
Xavier Claessens
8381ce472f doc: Hide some internal function 2019-07-10 10:29:04 -04:00
Xavier Claessens
5c9af3c75c doc: Add some empty lines to unbreak gtkdoc
For some reason gtkdoc thinks g_test_trap_fork() is undefined, unless
some more spacing is added.
2019-07-10 10:10:49 -04:00
Sonny Piers
40b3efe931 gio: fix typo in g_settings_reset documentation 2019-07-10 13:51:53 +00:00
Chun-wei Fan
45a21dcc3a Merge branch 'fix-module-tests-msvc' into 'master'
Fix module tests on Visual Studio builds

See merge request GNOME/glib!937
2019-07-10 07:30:41 +00:00
Matthias Clasen
5f8d787815 Ensure that the keyfile settings backend exists
We need to bring the type into existence.

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1822
2019-07-08 10:32:18 -04:00
Sonny Piers
06f27fc208 doc: fix typo in gio/gresource.c 2019-07-08 10:48:23 +00:00
Philip Withnall
4e538e674c Merge branch 'bug-787-investigation' into 'master'
Fix memory error with GDBusConnection in g_test_dbus_down()

Closes #787

See merge request GNOME/glib!963
2019-07-05 11:52:28 +00:00
David Strauss
979c92df17 Fix typo in request handle 2019-07-04 16:23:44 +00:00
Matthew Leeds
d4db5a8288 gtestdbus: Clarify comment on dropping connection ref
In _g_object_unref_and_wait_weak_notify() we take a weak reference and
then call g_object_unref() in an idle callback, which may look like
we're dropping a strong reference without having one. So change the
comment to make it more clear that the reference being dropped is held
by the caller.
2019-07-03 20:28:36 -07:00
Matthew Leeds
59ce6b10dc gdbus-connection-loss: Fix test failure
Now that we're not calling g_object_run_dispose() indirectly in
g_test_dbus_down() (see commit "Revert "gtestdbus: Properly close server
connections""), the test gdbus-connection-loss is failing with the
message "Bail out! GLib-GIO-FATAL-WARNING: Weak notify timeout, object
ref_count=1". This is because we're holding a reference to the singleton
connection object while calling session_bus_down() in the test's main().
So then we end up waiting for 30 seconds in
_g_object_unref_and_wait_weak_notify() for the GWeakNotify to be
triggered, which never happens.

The fix is to unref the connection before calling session_bus_down().
This is consistent with how other tests work, and is safe because the
only method called on the connection has already errored out, as
asserted by the test.
2019-07-03 20:28:36 -07:00
Matthew Leeds
1c63d5d539 Revert "Work around test failure in gdbus-names"
This reverts commit c37cd19fee.

Now that we've reverted the commit "gtestdbus: Properly close server
connections", g_test_dbus_down() no longer returns early and we no
longer need this workaround. Since the gdbus-names test seems to
properly unref its GDBusConnection objects it's not clear to me why it
needed the sleep to succeed. However even at the time the failure wasn't
reproducible according to this comment[1] so it's probably not worth
spending more effort trying to reproduce it now.

[1] https://gitlab.gnome.org/GNOME/glib/issues/787#note_214235
2019-07-03 20:21:34 -07:00