platform/upstream/glib.git
12 years agoSome minor updates of HACKING
Matthias Clasen [Tue, 27 Dec 2011 23:10:26 +0000 (18:10 -0500)]
Some minor updates of HACKING

12 years agoAdd undefined/no-undefined mode options to GTester
Simon McVittie [Wed, 14 Dec 2011 17:31:23 +0000 (17:31 +0000)]
Add undefined/no-undefined mode options to GTester

https://bugzilla.gnome.org/show_bug.cgi?id=666116

12 years agovarious tests: do not provoke SIGTRAP with -m no-undefined
Simon McVittie [Wed, 14 Dec 2011 18:08:59 +0000 (18:08 +0000)]
various tests: do not provoke SIGTRAP with -m no-undefined

Some of the GLib tests deliberately provoke warnings (or even fatal
errors) in a forked child. Normally, this is fine, but under valgrind
it's somewhat undesirable. We do want to follow fork(), so we can check
for leaks in child processes that exit gracefully; but we don't want to
be told about "leaks" in processes that are crashing, because there'd
be no point in cleaning those up anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=666116

12 years agoClarify documentation of fast/slow/thorough and quiet/verbose tests
Simon McVittie [Wed, 14 Dec 2011 17:32:16 +0000 (17:32 +0000)]
Clarify documentation of fast/slow/thorough and quiet/verbose tests

It turns out that there is no middle setting between fast and
slow/thorough, but there *is* a middle setting between quiet and verbose.

https://bugzilla.gnome.org/show_bug.cgi?id=666116

12 years agoRemove another unused AC_DEFINE
Matthias Clasen [Tue, 27 Dec 2011 22:45:40 +0000 (17:45 -0500)]
Remove another unused AC_DEFINE

Nothing was using the HAVE_GCOV define.

12 years agoDrop unused AC_SUBST
Matthias Clasen [Tue, 27 Dec 2011 22:20:36 +0000 (17:20 -0500)]
Drop unused AC_SUBST

DISABLE_MEM_POOLS is only used as define.

12 years agoRemove a bashism
Matthias Clasen [Tue, 27 Dec 2011 22:15:44 +0000 (17:15 -0500)]
Remove a bashism

12 years agoDrop a lot of dead configury for threads
Matthias Clasen [Tue, 27 Dec 2011 22:12:39 +0000 (17:12 -0500)]
Drop a lot of dead configury for threads

Much of this became obsolete by the recent rewrite of our
threading support.

12 years agoDon't put documentation in glibconfig.h
Matthias Clasen [Tue, 27 Dec 2011 21:22:13 +0000 (16:22 -0500)]
Don't put documentation in glibconfig.h

12 years agoMake glibconfig.h include guards consistent
Matthias Clasen [Tue, 27 Dec 2011 21:18:19 +0000 (16:18 -0500)]
Make glibconfig.h include guards consistent

12 years agoRemove a commented-out macro
Matthias Clasen [Tue, 27 Dec 2011 21:16:24 +0000 (16:16 -0500)]
Remove a commented-out macro

12 years agoRemove obsolescent AC_HEADER_STDC macro
Matthias Clasen [Tue, 27 Dec 2011 20:55:04 +0000 (15:55 -0500)]
Remove obsolescent AC_HEADER_STDC macro

We only used the resulting define in one place, and really,
these headers just have to be around or its not worth trying.

12 years agodocs: g_atexit: do not point in a direction for where to find details
Thomas Hindoe Paaboel Andersen [Sat, 24 Dec 2011 14:31:55 +0000 (15:31 +0100)]
docs: g_atexit: do not point in a direction for where to find details

https://bugzilla.gnome.org/show_bug.cgi?id=666804

12 years agoUpdated Norwegian Nynorsk translation
Åsmund Skjæveland [Mon, 26 Dec 2011 16:15:32 +0000 (17:15 +0100)]
Updated Norwegian Nynorsk translation

12 years agoDon't leak references to the menus
Matthias Clasen [Sun, 25 Dec 2011 04:01:17 +0000 (23:01 -0500)]
Don't leak references to the menus

12 years agoAdd a test for ids on submenu and section elements
Matthias Clasen [Sun, 25 Dec 2011 03:59:10 +0000 (22:59 -0500)]
Add a test for ids on submenu and section elements

The test checks that menus which are created via
<submenu id=...> or <section id=...> end up in the objects
hash table.

12 years agoMenu markup: Support ids on submenu and section elements
Matthias Clasen [Sun, 25 Dec 2011 03:58:16 +0000 (22:58 -0500)]
Menu markup: Support ids on submenu and section elements

This was supposed to work, but didn't.
Bug 666595.

12 years agodocs: Clarify non-NUL requirement in g_utf8_validate()
Benjamin Otte [Sat, 24 Dec 2011 13:26:24 +0000 (14:26 +0100)]
docs: Clarify non-NUL requirement in g_utf8_validate()

UTF8 validation is not about your character on a dating site, so don't
talk about meeting.

https://bugzilla.gnome.org/show_bug.cgi?id=666803

12 years agoAdd GSocketClient::event, for tracking socket client status
Dan Winship [Fri, 20 Aug 2010 17:04:19 +0000 (13:04 -0400)]
Add GSocketClient::event, for tracking socket client status

This can be used for debugging, or for progress UIs ("Connecting to
example.com..."), or to do low-level tweaking on the connection at
various points in the process.

https://bugzilla.gnome.org/show_bug.cgi?id=665805

12 years agoAdd g_socket_connection_connect(), etc
Dan Winship [Sun, 12 Jun 2011 20:29:04 +0000 (16:29 -0400)]
Add g_socket_connection_connect(), etc

Previously it was more or less assumed that GSocketConnections were
always connected, although this was not enforced. Make it explicit
that they don't need to be, and add methods to connect them, and
simplify GSocketClient by using those methods.

https://bugzilla.gnome.org/show_bug.cgi?id=665805

12 years agoUpdate GIO Visual C++ projects
Chun-wei Fan [Thu, 22 Dec 2011 12:18:11 +0000 (20:18 +0800)]
Update GIO Visual C++ projects

Link to zlib1.lib for release builds and zlib1d.lib for debug builds-
this is to be consistent across the board for the GTK+ stack (and many
other opensource code linking to the ZLib DLL on Windows)

12 years agoUpdate Visual C++ property sheets
Chun-wei Fan [Thu, 22 Dec 2011 10:49:01 +0000 (18:49 +0800)]
Update Visual C++ property sheets

"Install" the newly-introduced gremoteactiongroup.h header.

12 years agoGSettingsBackend: allow floating refs from read()
Ryan Lortie [Thu, 22 Dec 2011 05:24:20 +0000 (00:24 -0500)]
GSettingsBackend: allow floating refs from read()

Use g_variant_take_ref() to allow for backends to return floating
GVariant instances from their read() implementations.

12 years agoBug 666551-Fix a few dangling pointers
rodrigorivascosta [Thu, 22 Dec 2011 02:48:09 +0000 (10:48 +0800)]
Bug 666551-Fix a few dangling pointers

When removing an item from the list, check the next one's my_owner,
and fix it accordingly. And take this case into account when last
of the list is deleted.

Also, assign NULL to 'my_owner' in g_thread_xp_WakeConditionVariable.

12 years agoglib/tests/private.c: Fix compilation on Windows
Chun-wei Fan [Wed, 21 Dec 2011 03:24:09 +0000 (11:24 +0800)]
glib/tests/private.c: Fix compilation on Windows

-process.h must be included for _beginthreadex
-Use a cast to HANDLE on _beginthreadex to silence warnings on different
 types

12 years agoUpdated Norwegian bokmål translation
Kjartan Maraas [Wed, 21 Dec 2011 21:22:05 +0000 (22:22 +0100)]
Updated Norwegian bokmål translation

12 years agomenu: documentation fixes
Cosimo Cecchi [Wed, 21 Dec 2011 11:36:19 +0000 (12:36 +0100)]
menu: documentation fixes

g_menu_new_section() does not exist, the comment meant
g_menu_item_new_section().

12 years agoGObject: do checks on interface property install
Ryan Lortie [Wed, 21 Dec 2011 00:45:57 +0000 (19:45 -0500)]
GObject: do checks on interface property install

Add some checks to g_object_interface_install_property() similar to
those in g_object_class_install_property().

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGObject: require READ or WRITE on property install
Ryan Lortie [Wed, 21 Dec 2011 00:43:21 +0000 (19:43 -0500)]
GObject: require READ or WRITE on property install

g_object_class_install_property() currently lets you install properties
that are neither readable nor writable.  Add a check to prevent that.

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGObject: allow G_PARAM_CONSTRUCT on any override
Ryan Lortie [Wed, 21 Dec 2011 00:33:02 +0000 (19:33 -0500)]
GObject: allow G_PARAM_CONSTRUCT on any override

We were previously preventing implementations of an interface from
specifying G_PARAM_CONSTRUCT for a property of that interface if the
interface didn't specify it itself (or was readonly).

This is something that should only interest the implementation, so we
remove this restriction.

This allows 6 new possible override scenarios:

 - writable                 -> writable/construct
 - writable                 -> readwrite/construct
 - readwrite                -> readwrite/construct
 - writable/construct-only  -> writable/construct
 - writable/construct-only  -> readwrite/construct
 - readwrite/construct-only -> readwrite/construct

and we update the testcase to reflect this.

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGObject: add test for interface property overrides
Ryan Lortie [Tue, 20 Dec 2011 23:44:48 +0000 (18:44 -0500)]
GObject: add test for interface property overrides

Add a testcase to check all possibilities for overriding a property
specified on an interface from an implementation of that interface,
changing the type and flags.

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGObject: change the order of property checks
Ryan Lortie [Tue, 20 Dec 2011 23:41:03 +0000 (18:41 -0500)]
GObject: change the order of property checks

Change the order of the checks so that we hear about the 'biggest'
problem first.  Also, stop reporting problems after we report the first
one for a particular property.

Add some comments.

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGObject: fix property override type checks
Ryan Lortie [Tue, 20 Dec 2011 23:26:14 +0000 (18:26 -0500)]
GObject: fix property override type checks

The property override typecheck was meant to enforce the type on the
overriding property being exactly equal to the type on the interface
property.  Instead, g_type_is_a() was incorrectly used.

We could try to enforce equality, but if a property is read-only then it
should be possible for the implementation to type the property with any
subtype of the type specified on the interface (because returning a more
specific type will still satisfy the interface).  Likewise, if the
property is write-only then it should be possible for the implementation
to type the property with any supertype.

We implement the check this way.

https://bugzilla.gnome.org/show_bug.cgi?id=666616

12 years agoGSimpleAction: fix some whitespace fail
Ryan Lortie [Wed, 21 Dec 2011 00:12:56 +0000 (19:12 -0500)]
GSimpleAction: fix some whitespace fail

12 years agoGSimpleAction: tweak property flags
Ryan Lortie [Wed, 21 Dec 2011 00:11:19 +0000 (19:11 -0500)]
GSimpleAction: tweak property flags

There's no need for 'enabled' and 'state' to be marked construct-only.
These properties are writable at all times.

12 years agoGObject: fixup reversed logic in last commit
Ryan Lortie [Tue, 20 Dec 2011 20:29:16 +0000 (15:29 -0500)]
GObject: fixup reversed logic in last commit

Accidentally dropped a !.

12 years agogobject: Clean up logic in property checks
Ryan Lortie [Tue, 20 Dec 2011 20:12:44 +0000 (15:12 -0500)]
gobject: Clean up logic in property checks

Simplify some of the logic in this function.

  1) Simplify flag checks as per Colin's suggestions in
     https://bugzilla.gnome.org/show_bug.cgi?id=605667

  2) Don't repeatedly recheck if class_pspec is NULL.

12 years agoGAction: back out changes to property flags
Ryan Lortie [Tue, 20 Dec 2011 19:43:15 +0000 (14:43 -0500)]
GAction: back out changes to property flags

41e5ba86a791a17bb560dd7813ad7e849e0230dc introduced some changes to the
property flags of GAction.  These changes were not a reflection of the
actual interface of GAction but were necessary due to GObject being
overly-sensitive to flag changes on property overrides.

Now that the GObject bug is fixed, we can restore the GAction flags to
their correct values.

https://bugzilla.gnome.org/show_bug.cgi?id=666615

12 years agogobject: loosen property override flag restrictions
Ryan Lortie [Tue, 20 Dec 2011 19:36:29 +0000 (14:36 -0500)]
gobject: loosen property override flag restrictions

GObject enforces the following restrictions on property overrides:

  - must only add abilities: if the parent class supports
    readability/writability then the subclass must also support them.
    Subclasses are free to add readability/writability.

  - must not add additional restrictions: if the parent class doesn't
    have construct/construct-only restrictions then the subclass must
    not add them.  Subclasses are free to remove restrictions.

The problem with the previous implementation is that the check against
adding construct/construct-only restrictions was being done even if the
property was not previously writable.  As an example:

  "readable" and "writable only on construct"

was considered as being more restrictive than

  "read only".

This patch tweaks the check to allow the addition of
construct/construct-only restrictions for properties that were
previously read-only and are now being made writable.

https://bugzilla.gnome.org/show_bug.cgi?id=666615

12 years agoAdd references to the dbus interface docs on the wiki
Matthias Clasen [Tue, 20 Dec 2011 17:15:05 +0000 (12:15 -0500)]
Add references to the dbus interface docs on the wiki

And strip out the (now) redundant copy of that information
from the sources.

12 years agodocs: remove duplicate GMenuModel from gio.types
Ryan Lortie [Tue, 20 Dec 2011 03:56:05 +0000 (22:56 -0500)]
docs: remove duplicate GMenuModel from gio.types

12 years agowinxp threads: fix some condition variable races
Ryan Lortie [Mon, 19 Dec 2011 22:35:31 +0000 (17:35 -0500)]
winxp threads: fix some condition variable races

There are some races in the condition variable emulation code for
Windows XP with respect to timeouts while waiting.

First, in the event of a timeout, we never remove the waiter from the
condition variable.  This can cause crashes later.  That problem was
found by Rodrigo Rivas Costa.

Second, if the waiting thread times out and exits just as we were about
to call SetEvent() on its waiter event, we could end up trying to access
the waiter after it was closed/freed.  We need to hold on to the lock a
little bit longer to ensure that that's not possible.

https://bugzilla.gnome.org/show_bug.cgi?id=666551

12 years ago*bump*
Ryan Lortie [Mon, 19 Dec 2011 20:24:52 +0000 (15:24 -0500)]
*bump*

12 years agognetworkmonitornetlink.c: Fix a gsize->gssize
Dan Winship [Mon, 19 Dec 2011 20:19:19 +0000 (15:19 -0500)]
gnetworkmonitornetlink.c: Fix a gsize->gssize

https://bugzilla.gnome.org/show_bug.cgi?id=666422

12 years agoglib 2.31.6 2.31.6
Ryan Lortie [Mon, 19 Dec 2011 18:38:21 +0000 (13:38 -0500)]
glib 2.31.6

12 years agogitignore
Ryan Lortie [Mon, 19 Dec 2011 18:37:06 +0000 (13:37 -0500)]
gitignore

12 years agoDrop public menu APIs from GApplication
Ryan Lortie [Mon, 19 Dec 2011 15:47:45 +0000 (10:47 -0500)]
Drop public menu APIs from GApplication

This is moving to Gtk, but we don't want to do it all right now.

12 years agoDrop the GApplication menu test
Ryan Lortie [Mon, 19 Dec 2011 15:47:28 +0000 (10:47 -0500)]
Drop the GApplication menu test

12 years agoUpdated Spanish translation
Daniel Mustieles [Mon, 19 Dec 2011 16:13:11 +0000 (17:13 +0100)]
Updated Spanish translation

12 years agogsettings-tool: allow specifying custom schema dirs
Giovanni Campagna [Sat, 17 Dec 2011 19:08:50 +0000 (20:08 +0100)]
gsettings-tool: allow specifying custom schema dirs

It happens that one wants to customize settings for plugins or
shell extensions, that installing schemas in nonstandard locations.
This patch adds the --schemadir option to gsettings, and ensure
that the appropriate schema is found.

https://bugzilla.gnome.org/show_bug.cgi?id=666415

12 years agogdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"
Florian Müllner [Mon, 19 Dec 2011 13:52:10 +0000 (14:52 +0100)]
gdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"

The field has now been standardized, so drop the prefix.

12 years agoTeach gtk-doc about G_GNUC_WARN_UNUSED_RESULT
Matthias Clasen [Mon, 19 Dec 2011 12:45:43 +0000 (07:45 -0500)]
Teach gtk-doc about G_GNUC_WARN_UNUSED_RESULT

12 years agoGApplication: receiving end of GRemoteActionGroup
Ryan Lortie [Sat, 17 Dec 2011 05:52:57 +0000 (00:52 -0500)]
GApplication: receiving end of GRemoteActionGroup

Use the fact that the action group exporter now speaks to
GRemoteActionGroup to get the platform data into GApplicion without
hacks.

https://bugzilla.gnome.org/show_bug.cgi?id=665737

12 years agoaction group exporter: kill GApplication hackery
Ryan Lortie [Sat, 17 Dec 2011 05:26:11 +0000 (00:26 -0500)]
action group exporter: kill GApplication hackery

Use the GRemoteActionGroup interface, if available, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=665737

12 years agointroduce GRemoteActionGroup
Ryan Lortie [Sat, 17 Dec 2011 05:17:08 +0000 (00:17 -0500)]
introduce GRemoteActionGroup

This interfaceifies the extra functions that were on GDBusActionGroup
for dealing with platform data.

The two main benefits of doing this:

  - no longer have to do a silly song and dance in GApplication to avoid
    calling GDBusActionGroup API from non-dbus-aware code

  - the interface can be reused by the action group exporter to avoid
    ugly and unbindable hook callbacks

https://bugzilla.gnome.org/show_bug.cgi?id=665737

12 years agoGApplication: send platform data for actions again
Ryan Lortie [Sat, 17 Dec 2011 03:24:03 +0000 (22:24 -0500)]
GApplication: send platform data for actions again

Use the _full variants of the GDBusActionGroup API to send platform data
for action invocations once again.

12 years agoGDBusActionGroup: add _full variants of activation
Ryan Lortie [Sat, 17 Dec 2011 03:23:30 +0000 (22:23 -0500)]
GDBusActionGroup: add _full variants of activation

This allows the platform_data to be explicitly specified.

12 years agoRevert "GDBusActionGroup: add static platform registration"
Ryan Lortie [Sat, 17 Dec 2011 02:25:57 +0000 (21:25 -0500)]
Revert "GDBusActionGroup: add static platform registration"

This reverts commit fcc9902e98a6a6568a1150441c8680fd4615d437.

12 years agoGApplication: emit signals on action changes
Ryan Lortie [Fri, 16 Dec 2011 16:39:24 +0000 (11:39 -0500)]
GApplication: emit signals on action changes

Now that we're a GActionMap the story about propagating signals from our
(now-constant) internal action group is vastly simplified.  If someone
calls g_application_set_action_group() then signals will stop working --
but this function is deprecated and they never worked before, so no big
loss there.

https://bugzilla.gnome.org/show_bug.cgi?id=643736

12 years agowindows XP threads: fix hilariously obvious race
Ryan Lortie [Thu, 15 Dec 2011 18:27:27 +0000 (13:27 -0500)]
windows XP threads: fix hilariously obvious race

I tried to do a double-checked lock without the double check.

Rodrigo Rivas Costa caught the problem and suggested the (obviously
correct) fix.

https://bugzilla.gnome.org/show_bug.cgi?id=666296

12 years agoGDBusActionGroup: add static platform registration
Ryan Lortie [Wed, 14 Dec 2011 18:31:27 +0000 (13:31 -0500)]
GDBusActionGroup: add static platform registration

We provide a mechanism by which a 'platform' (eg: Gtk) can register some
hook functions to be called to collect platform-data at the point of
sending an outgoing action activation request and also to inform the
platform of this data on incoming requests (before and after dispatching
the actual request).

This can be used for forwarding timestamp and startup-notification
information (as is presently done in GApplication) but the before/after
hook could also be used for acquiring/releasing the Gdk lock or other
similar things.

https://bugzilla.gnome.org/show_bug.cgi?id=665737

12 years agoAdded API g_queue_free_full().
Ravi Sankar Guntur [Wed, 14 Dec 2011 14:47:54 +0000 (20:17 +0530)]
Added API g_queue_free_full().

g_queue_free_full(), to free a Queue including its dynamically-allocated elements.
On similar lines to List and Slist.

void  g_queue_free_full  (GQueue  *queue,  GDestroyNotify    free_func);

Test case covering g_queue_free_full() is added.
Added export symbol to glib.symbols.

Closes Bug: https://bugzilla.gnome.org/show_bug.cgi?id=657433

Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
12 years agoGDBusActionGroup: Fix a typo in docs
Colin Walters [Thu, 15 Dec 2011 14:47:15 +0000 (09:47 -0500)]
GDBusActionGroup: Fix a typo in docs

12 years agoconfigure.ac: robustify netlink.h check
Dan Winship [Wed, 14 Dec 2011 15:19:13 +0000 (10:19 -0500)]
configure.ac: robustify netlink.h check

https://bugzilla.gnome.org/show_bug.cgi?id=666173

12 years agoGBytes: add a size argument to g_bytes_get_data
Stef Walter [Fri, 9 Dec 2011 17:19:24 +0000 (18:19 +0100)]
GBytes: add a size argument to g_bytes_get_data

 * An out size argument so that this is more easily bindable
   by gobject-introspection.

https://bugzilla.gnome.org/show_bug.cgi?id=665879

12 years agoInitialize service_loop before running the service thread
Chris Coulson [Wed, 14 Dec 2011 14:00:56 +0000 (14:00 +0000)]
Initialize service_loop before running the service thread

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666129

12 years agomenu markup: tolerate not having a hash table of objects
Matthias Clasen [Thu, 15 Dec 2011 02:05:38 +0000 (21:05 -0500)]
menu markup: tolerate not having a hash table of objects

Various places in the code were assuming that the hash table was always
available. Fix this, and also avoid leaking strings now that the hash
table may be NULL.

Based on a patch by Simon McVittie, bug 666167

12 years agog_array_free, g_ptr_array_free: decrement refcount if not the last ref
Simon McVittie [Wed, 14 Dec 2011 16:56:15 +0000 (16:56 +0000)]
g_array_free, g_ptr_array_free: decrement refcount if not the last ref

foo_free is conceptually "worth" one unref; not decrementing the
refcount here means the GArray or GPtrArray wrapper (but not its
contents) would leak in the following call sequence:

    p = g_ptr_array_new ();
    g_ptr_array_ref (p);
    g_ptr_array_free (p, TRUE);
    g_ptr_array_unref (p);

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agoGArray, GPtrArray: factor out the actual freeing
Simon McVittie [Wed, 14 Dec 2011 16:53:24 +0000 (16:53 +0000)]
GArray, GPtrArray: factor out the actual freeing

Depending how the array is freed, we may want to free the underlying
array (the "segment"), the struct wrapper or both.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agog_key_file_get_string_list: don't leak the pieces on error
Simon McVittie [Wed, 14 Dec 2011 16:46:56 +0000 (16:46 +0000)]
g_key_file_get_string_list: don't leak the pieces on error

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agotls-interaction test: use a weak pointer instead of a deliberate use-after-free
Simon McVittie [Tue, 13 Dec 2011 18:18:27 +0000 (18:18 +0000)]
tls-interaction test: use a weak pointer instead of a deliberate use-after-free

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agogdbus tests: remove buggy use of GMainLoop
Ryan Lortie [Wed, 14 Dec 2011 01:54:24 +0000 (20:54 -0500)]
gdbus tests: remove buggy use of GMainLoop

g_main_loop_quit() only quits mainloops that are currently running --
not ones that may run in the future.  The way the gdbus-threading tests
are written can possibly result in a call to g_main_loop_quit() before
g_main_loop_run() has started.

The mainloops aren't actually used for anything other than signalling
the completion of the threads, so just use g_thread_join() for that.

https://bugzilla.gnome.org/show_bug.cgi?id=666129

12 years agotwo test fixes for ARM
Ryan Lortie [Wed, 14 Dec 2011 14:32:11 +0000 (09:32 -0500)]
two test fixes for ARM

First, some ARM systems are not fast enough to meet the 30 second
deadline in gwakeuptest.c, so increase that to 60.

Second, we have some signed/unsigned woes in the gparam transform tests.

12 years agoPlug some leaks in the GIO tests
Simon McVittie [Tue, 13 Dec 2011 18:18:07 +0000 (18:18 +0000)]
Plug some leaks in the GIO tests

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agohash test: avoid leaking various keys and values
Simon McVittie [Tue, 13 Dec 2011 14:46:02 +0000 (14:46 +0000)]
hash test: avoid leaking various keys and values

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agoGOptionContext test: free all arguments, not just the remaining ones
Simon McVittie [Mon, 12 Dec 2011 18:56:21 +0000 (18:56 +0000)]
GOptionContext test: free all arguments, not just the remaining ones

On success, g_option_context_parse alters argv by removing options that
it understood, so g_strfreev is insufficient. Instead, take a shallow
copy and free all of the arguments in that, then free the array argv
but not its contents.

Also, improve the checks in error cases, by checking that argv has
not been altered in this way.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agovarious GLib tests: plug memory leaks
Simon McVittie [Tue, 13 Dec 2011 19:01:42 +0000 (19:01 +0000)]
various GLib tests: plug memory leaks

These don't really matter, since it's test code, but they do obscure
real leaks in the library.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Acked-by: Matthias Clasen <mclasen@redhat.com>
12 years agotestglib: test_file_functions: don't close fd if it's -1
Simon McVittie [Mon, 12 Dec 2011 15:55:59 +0000 (15:55 +0000)]
testglib: test_file_functions: don't close fd if it's -1

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agoRevert "g_menu_markup_start_element: tolerate not having a hash table of objects"
Simon McVittie [Wed, 14 Dec 2011 12:39:06 +0000 (12:39 +0000)]
Revert "g_menu_markup_start_element: tolerate not having a hash table of objects"

This reverts commit bcdb60641196f98482b5e17fcc96a92589deba35,
accidentally pushed before it was reviewed.

12 years agog_menu_markup_start_element: tolerate not having a hash table of objects
Simon McVittie [Wed, 14 Dec 2011 12:31:31 +0000 (12:31 +0000)]
g_menu_markup_start_element: tolerate not having a hash table of objects

I don't know whether this is the right fix, but gio/tests/gmenumodel
crashes out, which can't be right.

12 years agog_variant_byteswap: don't leak serialised.data
Simon McVittie [Mon, 12 Dec 2011 18:58:03 +0000 (18:58 +0000)]
g_variant_byteswap: don't leak serialised.data

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agoGDBusActionGroup: don't leak param_str
Simon McVittie [Tue, 13 Dec 2011 18:16:55 +0000 (18:16 +0000)]
GDBusActionGroup: don't leak param_str

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agog_data_set_internal: avoid use-after-free if datalist is in dataset
Simon McVittie [Tue, 13 Dec 2011 14:44:18 +0000 (14:44 +0000)]
g_data_set_internal: avoid use-after-free if datalist is in dataset

Removing the last thing in a dataset frees the dataset, and if the
datalist was in a dataset, we can't safely unlock it after the dataset
has been freed. Unlock it sooner.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agog_strcompress: check that source is non-NULL rather than just crashing
Simon McVittie [Mon, 12 Dec 2011 18:37:10 +0000 (18:37 +0000)]
g_strcompress: check that source is non-NULL rather than just crashing

Calling this function with a NULL argument is considered to be invalid,
but one of the regression tests does it anyway (to watch it crash), which
seems a good indication that it's expected to be somewhat common.
Let's check it rather than segfaulting.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
12 years agog_dbus_action_group_changed: don't leak iterator and its contents
Simon McVittie [Tue, 13 Dec 2011 18:17:13 +0000 (18:17 +0000)]
g_dbus_action_group_changed: don't leak iterator and its contents

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agoGKeyFile: free group comments when the group is removed
Simon McVittie [Mon, 12 Dec 2011 18:35:14 +0000 (18:35 +0000)]
GKeyFile: free group comments when the group is removed

These were leaked. Valgrind was sad.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agog_hmac_get_string: don't allocate and leak an unused buffer
Simon McVittie [Mon, 12 Dec 2011 18:34:47 +0000 (18:34 +0000)]
g_hmac_get_string: don't allocate and leak an unused buffer

Also document why we're not actually using the buffer for anything.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agog_hmac_copy: initialize the refcount
Simon McVittie [Mon, 12 Dec 2011 15:54:50 +0000 (15:54 +0000)]
g_hmac_copy: initialize the refcount

In practice, the uninitialized refcount will typically mean that the copy is
never freed, and leaks.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
12 years agoAdd an explicit deprecation note to g_thread_init
Matthias Clasen [Wed, 14 Dec 2011 12:16:04 +0000 (07:16 -0500)]
Add an explicit deprecation note to g_thread_init

https://bugzilla.gnome.org/show_bug.cgi?id=666145

12 years agoAdd another menu parser test
Matthias Clasen [Wed, 14 Dec 2011 05:10:34 +0000 (00:10 -0500)]
Add another menu parser test

This one concerns itself with objects.

12 years agoGMenuModel: Flesh out the docs some more
Matthias Clasen [Wed, 14 Dec 2011 04:16:25 +0000 (23:16 -0500)]
GMenuModel: Flesh out the docs some more

12 years agoGMenu: purge references to GMenuProxy from the docs
Matthias Clasen [Wed, 14 Dec 2011 04:06:16 +0000 (23:06 -0500)]
GMenu: purge references to GMenuProxy from the docs

12 years agodocumentation fixes
Stef Walter [Wed, 14 Dec 2011 04:00:16 +0000 (23:00 -0500)]
documentation fixes

Fixes for gtk-doc warnings.

http://bugzilla.gnome.org/show_bug.cgi?id=66469

https://bugzilla.gnome.org/show_bug.cgi?id=664699

12 years agoImprove GNetworkMonitor docs
Matthias Clasen [Tue, 13 Dec 2011 17:56:20 +0000 (12:56 -0500)]
Improve GNetworkMonitor docs

Make sure we get signal and property docs, and mention
the extension point in the overview.

12 years agognetworkmonitornetlink.c: Fix compilation on RHEL 6.2
Christophe Fergeau [Mon, 12 Dec 2011 14:06:41 +0000 (15:06 +0100)]
gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2

When trying to compile glib master on a RHEL 6.2 system, it fails with:

make[4]: Entering directory `/home/teuf/gnome/src/glib/gio'
  CC     libgio_2_0_la-gnetworkmonitornetlink.lo
In file included from gnetworkmonitornetlink.c:25:
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before 'sa_family_t'
gnetworkmonitornetlink.c: In function 'g_network_monitor_netlink_initable_init':
gnetworkmonitornetlink.c:99: error: 'struct sockaddr_nl' has no member named 'nl_family'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pid'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pad'
gnetworkmonitornetlink.c:101: error: 'struct sockaddr_nl' has no member named 'nl_groups'
make[4]: *** [libgio_2_0_la-gnetworkmonitornetlink.lo] Error 1

sa_family_t is defined in sys/socket.h, this commit makes sure this header is included before netlink.h

This fixes bgo bug #666001

12 years agobump version
Ryan Lortie [Tue, 13 Dec 2011 14:16:51 +0000 (09:16 -0500)]
bump version

12 years agoUpdate VS property sheets
Chun-wei Fan [Tue, 13 Dec 2011 04:12:48 +0000 (12:12 +0800)]
Update VS property sheets

"Install" the newly-added public headers in GLib and GIO, such as the ones
for GMenuModel, etc.

12 years agoFix wording
Alexandre Franke [Mon, 12 Dec 2011 19:36:29 +0000 (20:36 +0100)]
Fix wording

délai épuisé has been replaced with délai dépassé

12 years agoglib 2.31.4 2.31.4
Ryan Lortie [Mon, 12 Dec 2011 18:28:24 +0000 (13:28 -0500)]
glib 2.31.4

12 years agoGActionGroupExporter: stop using signal IDs
Ryan Lortie [Mon, 12 Dec 2011 18:28:09 +0000 (13:28 -0500)]
GActionGroupExporter: stop using signal IDs

GDBusConnection recently changed to dispatching its GDestroyNotify calls
from an idle instead of on-the-spot.  Under the previous regime, we
would destroy-notify the action group export of a GtkApplicationWindow
at the point it was removed from the application (ie: slightly before
being disposed).

With the destroy notify now deferred to an idle, the window has already
been disposed, so the signal handlers have already been disconnected.

Avoid the problem by dropping our use of signal IDs and just do
g_signal_handlers_disconnect_by_func(), which doesn't complain if there
is no connection.